/* Generated by Cython 0.29 */

#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"
#define CYTHON_HEX_VERSION 0x001D00F0
#define CYTHON_FUTURE_DIVISION 0
#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
#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"
  #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 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_USE_DICT_VERSIONS
#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);\
        }\
    }
#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
#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; // PyThread_create_key reports success always
}
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 // TSS (Thread Specific Storage) API
#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 <stdint.h>
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <memory>
#include <string.h>
#include <string>
#include <vector>
#include <utility>
#include <unordered_map>
#include <unordered_set>
#include <stdio.h>
#include "pythread.h"
#include "arrow/python/platform.h"
#include <Python.h>
#include "numpy/halffloat.h"
#include "arrow/api.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/compute/api.h"
#include "arrow/python/api.h"
#include "arrow/python/init.h"
#include "arrow/python/config.h"
#include "arrow/python/inference.h"
#include "arrow/python/benchmark.h"
#include "arrow/util/compression.h"
#include "arrow/util/thread-pool.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_DEFAULT 0
#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/scalar.pxi",
  "pyarrow/array.pxi",
  "pyarrow/types.pxi",
  "pyarrow/io.pxi",
  "pyarrow/ipc.pxi",
  "pyarrow/lib.pyx",
  "pyarrow/memory.pxi",
  "stringsource",
  "pyarrow/builder.pxi",
  "pyarrow/table.pxi",
  "pyarrow/lib.pxd",
  "pyarrow/io-hdfs.pxi",
  "pyarrow/feather.pxi",
  "pyarrow/serialization.pxi",
  "pyarrow/benchmark.pxi",
  "pyarrow/public-api.pxi",
  "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_DictionaryType;
struct __pyx_obj_7pyarrow_3lib_TimestampType;
struct __pyx_obj_7pyarrow_3lib_Time32Type;
struct __pyx_obj_7pyarrow_3lib_Time64Type;
struct __pyx_obj_7pyarrow_3lib_FixedSizeBinaryType;
struct __pyx_obj_7pyarrow_3lib_Decimal128Type;
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_Int8Value;
struct __pyx_obj_7pyarrow_3lib_Int64Value;
struct __pyx_obj_7pyarrow_3lib_ListValue;
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_Array;
struct __pyx_obj_7pyarrow_3lib_Tensor;
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_UnionArray;
struct __pyx_obj_7pyarrow_3lib_StringArray;
struct __pyx_obj_7pyarrow_3lib_BinaryArray;
struct __pyx_obj_7pyarrow_3lib_DictionaryArray;
struct __pyx_obj_7pyarrow_3lib_ChunkedArray;
struct __pyx_obj_7pyarrow_3lib_Column;
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_LoggingMemoryPool;
struct __pyx_obj_7pyarrow_3lib_ProxyMemoryPool;
struct __pyx_obj_7pyarrow_3lib_StructType;
struct __pyx_obj_7pyarrow_3lib_UnionType;
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_HalfFloatValue;
struct __pyx_obj_7pyarrow_3lib_FloatValue;
struct __pyx_obj_7pyarrow_3lib_DoubleValue;
struct __pyx_obj_7pyarrow_3lib_DecimalValue;
struct __pyx_obj_7pyarrow_3lib_BinaryValue;
struct __pyx_obj_7pyarrow_3lib_DictionaryValue;
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_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__RecordBatchWriter;
struct __pyx_obj_7pyarrow_3lib__RecordBatchReader;
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___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6_iterchunks;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_itercolumns;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_download;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_upload;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_10___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11___iter__;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple;
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_genexpr;
struct __pyx_opt_args_7pyarrow_3lib_decimal128;
struct __pyx_opt_args_7pyarrow_3lib_dictionary;

/* "pyarrow/types.pxi":86
 * # 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":1157
 * 
 * 
 * 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":1230
 * 
 * 
 * cpdef DictionaryType dictionary(DataType index_type, Array dict_values,             # <<<<<<<<<<<<<<
 *                                 bint ordered=False):
 *     """
 */
struct __pyx_opt_args_7pyarrow_3lib_dictionary {
  int __pyx_n;
  int ordered;
};

/* "pyarrow/lib.pxd":32
 * 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":37
 * 
 * 
 * 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":47
 * 
 * 
 * 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;
};


/* "pyarrow/lib.pxd":56
 * 
 * 
 * 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":61
 * 
 * 
 * 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":66
 * 
 * 
 * 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":71
 * 
 * 
 * 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":76
 * 
 * 
 * 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":81
 * 
 * 
 * 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":86
 * 
 * 
 * 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":91
 * 
 * 
 * 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":102
 * 
 * 
 * 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":111
 * 
 * 
 * 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":116
 * 
 * 
 * cdef class NAType(Scalar):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_NAType {
  struct __pyx_obj_7pyarrow_3lib_Scalar __pyx_base;
};


/* "pyarrow/lib.pxd":120
 * 
 * 
 * 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":131
 * 
 * 
 * cdef class Int8Value(ArrayValue):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_Int8Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


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


/* "pyarrow/lib.pxd":139
 * 
 * 
 * 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":150
 * 
 * 
 * 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":155
 * 
 * 
 * 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":163
 * 
 * 
 * cdef class StringValue(ArrayValue):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_StringValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


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


/* "pyarrow/lib.pxd":171
 * 
 * 
 * cdef class Array:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CArray] sp_array
 */
struct __pyx_obj_7pyarrow_3lib_Array {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_Array *__pyx_vtab;
  std::shared_ptr< arrow::Array>  sp_array;
   arrow::Array *ap;
  struct __pyx_obj_7pyarrow_3lib_DataType *type;
};


/* "pyarrow/lib.pxd":184
 * 
 * 
 * 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":195
 * 
 * 
 * cdef class NullArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_NullArray {
  struct __pyx_obj_7pyarrow_3lib_Array __pyx_base;
};


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


/* "pyarrow/lib.pxd":287
 * 
 * 
 * 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":298
 * 
 * 
 * cdef class ChunkedArray:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CChunkedArray] sp_chunked_array
 */
struct __pyx_obj_7pyarrow_3lib_ChunkedArray {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray *__pyx_vtab;
  std::shared_ptr< arrow::ChunkedArray>  sp_chunked_array;
   arrow::ChunkedArray *chunked_array;
};


/* "pyarrow/lib.pxd":307
 * 
 * 
 * cdef class Column:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CColumn] sp_column
 */
struct __pyx_obj_7pyarrow_3lib_Column {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_Column *__pyx_vtab;
  std::shared_ptr< arrow::Column>  sp_column;
   arrow::Column *column;
};


/* "pyarrow/lib.pxd":315
 * 
 * 
 * cdef class Table:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CTable] sp_table
 */
struct __pyx_obj_7pyarrow_3lib_Table {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_Table *__pyx_vtab;
  std::shared_ptr< arrow::Table>  sp_table;
   arrow::Table *table;
};


/* "pyarrow/lib.pxd":323
 * 
 * 
 * cdef class RecordBatch:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CRecordBatch] sp_batch
 */
struct __pyx_obj_7pyarrow_3lib_RecordBatch {
  PyObject_HEAD
  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":332
 * 
 * 
 * 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":342
 * 
 * 
 * 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":347
 * 
 * 
 * cdef class NativeFile:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[RandomAccessFile] rd_file
 */
struct __pyx_obj_7pyarrow_3lib_NativeFile {
  PyObject_HEAD
  struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *__pyx_vtab;
  std::shared_ptr<arrow::io::RandomAccessFile>  rd_file;
  std::shared_ptr<arrow::io::OutputStream>  wr_file;
  int is_readable;
  int is_writable;
  int closed;
  int own_file;
  PyObject *__weakref__;
};


/* "pyarrow/memory.pxi":43
 * 
 * 
 * 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":56
 * 
 * 
 * cdef class ProxyMemoryPool(MemoryPool):             # <<<<<<<<<<<<<<
 *     """
 *     Derived MemoryPool class 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":206
 * 
 * 
 * cdef class StructType(DataType):             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 */
struct __pyx_obj_7pyarrow_3lib_StructType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
};


/* "pyarrow/types.pxi":230
 * 
 * 
 * cdef class UnionType(DataType):             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 */
struct __pyx_obj_7pyarrow_3lib_UnionType {
  struct __pyx_obj_7pyarrow_3lib_DataType __pyx_base;
};


/* "pyarrow/scalar.pxi":22
 * 
 * 
 * cdef class NullType(Scalar):             # <<<<<<<<<<<<<<
 *     """
 *     Null (NA) value singleton
 */
struct __pyx_obj_7pyarrow_3lib_NullType {
  struct __pyx_obj_7pyarrow_3lib_Scalar __pyx_base;
};


/* "pyarrow/scalar.pxi":84
 * 
 * 
 * cdef class BooleanValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
struct __pyx_obj_7pyarrow_3lib_BooleanValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":98
 * 
 * 
 * cdef class UInt8Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
struct __pyx_obj_7pyarrow_3lib_UInt8Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":105
 * 
 * 
 * cdef class Int16Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
struct __pyx_obj_7pyarrow_3lib_Int16Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":112
 * 
 * 
 * cdef class UInt16Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
struct __pyx_obj_7pyarrow_3lib_UInt16Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":119
 * 
 * 
 * cdef class Int32Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
struct __pyx_obj_7pyarrow_3lib_Int32Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":126
 * 
 * 
 * cdef class UInt32Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
struct __pyx_obj_7pyarrow_3lib_UInt32Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":140
 * 
 * 
 * cdef class UInt64Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
struct __pyx_obj_7pyarrow_3lib_UInt64Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":147
 * 
 * 
 * cdef class Date32Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
struct __pyx_obj_7pyarrow_3lib_Date32Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":157
 * 
 * 
 * cdef class Date64Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
struct __pyx_obj_7pyarrow_3lib_Date64Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":165
 * 
 * 
 * cdef class Time32Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
struct __pyx_obj_7pyarrow_3lib_Time32Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":180
 * 
 * 
 * cdef class Time64Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
struct __pyx_obj_7pyarrow_3lib_Time64Value {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":229
 * 
 * 
 * cdef class TimestampValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
struct __pyx_obj_7pyarrow_3lib_TimestampValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":257
 * 
 * 
 * cdef class HalfFloatValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
struct __pyx_obj_7pyarrow_3lib_HalfFloatValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":264
 * 
 * 
 * cdef class FloatValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
struct __pyx_obj_7pyarrow_3lib_FloatValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":271
 * 
 * 
 * cdef class DoubleValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
struct __pyx_obj_7pyarrow_3lib_DoubleValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":278
 * 
 * 
 * cdef class DecimalValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
struct __pyx_obj_7pyarrow_3lib_DecimalValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":294
 * 
 * 
 * cdef class BinaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
struct __pyx_obj_7pyarrow_3lib_BinaryValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/scalar.pxi":410
 * 
 * 
 * cdef class DictionaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
struct __pyx_obj_7pyarrow_3lib_DictionaryValue {
  struct __pyx_obj_7pyarrow_3lib_ArrayValue __pyx_base;
};


/* "pyarrow/array.pxi":238
 * 
 * 
 * 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":871
 * 
 * 
 * cdef class Date32Array(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_Date32Array {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/array.pxi":875
 * 
 * 
 * cdef class Date64Array(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_Date64Array {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/array.pxi":879
 * 
 * 
 * cdef class TimestampArray(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_TimestampArray {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/array.pxi":883
 * 
 * 
 * cdef class Time32Array(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_Time32Array {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __pyx_base;
};


/* "pyarrow/array.pxi":887
 * 
 * 
 * cdef class Time64Array(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_7pyarrow_3lib_Time64Array {
  struct __pyx_obj_7pyarrow_3lib_NumericArray __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":507
 * 
 * 
 * cdef class PythonFile(NativeFile):             # <<<<<<<<<<<<<<
 *     cdef:
 *         object handle
 */
struct __pyx_obj_7pyarrow_3lib_PythonFile {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
  PyObject *handle;
};


/* "pyarrow/io.pxi":547
 * 
 * 
 * cdef class MemoryMappedFile(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     Supports 'r', 'r+w', 'w' modes
 */
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":655
 * 
 * 
 * cdef class OSFile(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     Supports 'r', 'w' modes
 */
struct __pyx_obj_7pyarrow_3lib_OSFile {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
  PyObject *path;
};


/* "pyarrow/io.pxi":698
 * 
 * 
 * cdef class FixedSizeBufferWriter(NativeFile):             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, Buffer buffer):
 */
struct __pyx_obj_7pyarrow_3lib_FixedSizeBufferWriter {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "pyarrow/io.pxi":937
 * 
 * 
 * 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":963
 * 
 * 
 * cdef class MockOutputStream(NativeFile):             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */
struct __pyx_obj_7pyarrow_3lib_MockOutputStream {
  struct __pyx_obj_7pyarrow_3lib_NativeFile __pyx_base;
};


/* "pyarrow/io.pxi":974
 * 
 * 
 * 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[CHadoopFileSystem] 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":464
 * # 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":483
 * 
 * 
 * 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":100
 * 
 * 
 * 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":150
 * # File and stream readers and writers
 * 
 * cdef class _RecordBatchWriter:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CRecordBatchWriter] writer
 */
struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter {
  PyObject_HEAD
  std::shared_ptr< arrow::ipc::RecordBatchWriter>  writer;
  std::shared_ptr<arrow::io::OutputStream>  sink;
  int closed;
};


/* "pyarrow/ipc.pxi":244
 * 
 * 
 * cdef class _RecordBatchReader:             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[CRecordBatchReader] reader
 */
struct __pyx_obj_7pyarrow_3lib__RecordBatchReader {
  PyObject_HEAD
  std::shared_ptr< arrow::ipc::RecordBatchReader>  reader;
  std::shared_ptr<arrow::io::InputStream>  in_stream;
  struct __pyx_obj_7pyarrow_3lib_Schema *schema;
};


/* "pyarrow/ipc.pxi":310
 * 
 * 
 * cdef class _RecordBatchFileWriter(_RecordBatchWriter):             # <<<<<<<<<<<<<<
 * 
 *     def _open(self, sink, Schema schema):
 */
struct __pyx_obj_7pyarrow_3lib__RecordBatchFileWriter {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter __pyx_base;
};


/* "pyarrow/ipc.pxi":323
 * 
 * 
 * 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":46
 * 
 * 
 * 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":216
 * 
 * 
 * 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":214
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self[i]
 */
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":252
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self[i]
 */
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":483
 *         return pyarrow_wrap_field(self.schema.field(index))
 * 
 *     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":314
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___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/array.pxi":524
 *         return self.sp_array.get().null_count()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___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":97
 *         return self.chunked_array.null_count()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for chunk in self.iterchunks():
 *             for item in chunk:
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_5___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":283
 *         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_6_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":1498
 *         return self.column(index)
 * 
 *     def itercolumns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterator over all columns in their numerical order
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_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/io.pxi":366
 *             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_8_download {
  PyObject_HEAD
  PyObject *__pyx_v_cleanup;
  int __pyx_v_done;
  PyObject *__pyx_v_stream;
  PyObject *__pyx_v_write_queue;
};


/* "pyarrow/io.pxi":453
 *             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_9_upload {
  PyObject_HEAD
  int __pyx_v_done;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self;
  PyObject *__pyx_v_write_queue;
};


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


/* "pyarrow/ipc.pxi":263
 *         self.schema = pyarrow_wrap_schema(self.reader.get().schema())
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.read_next_batch()
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11___iter__ {
  PyObject_HEAD
  struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__pyx_v_self;
};


/* "pyarrow/serialization.pxi":23
 * 
 * 
 * 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_12_is_named_tuple {
  PyObject_HEAD
  PyObject *__pyx_v_f;
};


/* "pyarrow/serialization.pxi":31
 *     if not isinstance(f, tuple):
 *         return False
 *     return all(type(n) == str for n in f)             # <<<<<<<<<<<<<<
 * 
 * 
 */
struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple *__pyx_outer_scope;
  PyObject *__pyx_v_n;
};



/* "pyarrow/memory.pxi":23
 * 
 * 
 * cdef class MemoryPool:             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */

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":89
 * 
 * 
 * cdef class DataType:             # <<<<<<<<<<<<<<
 *     """
 *     Base type for Apache Arrow data type instances. Wraps C++ arrow::DataType
 */

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


/* "pyarrow/types.pxi":192
 * 
 * 
 * cdef class ListType(DataType):             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 */

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":170
 * 
 * 
 * cdef class DictionaryType(DataType):             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 */

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":264
 * 
 * 
 * cdef class TimestampType(DataType):             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 */

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":295
 * 
 * 
 * cdef class Time32Type(DataType):             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 */

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":306
 * 
 * 
 * cdef class Time64Type(DataType):             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 */

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":317
 * 
 * 
 * cdef class FixedSizeBinaryType(DataType):             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 */

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":332
 * 
 * 
 * cdef class Decimal128Type(FixedSizeBinaryType):             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 */

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":350
 * 
 * 
 * cdef class Field:             # <<<<<<<<<<<<<<
 *     """
 *     Represents a named field, with a data type, nullability, and optional
 */

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":467
 * 
 * 
 * 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":43
 * 
 * 
 * cdef class ArrayValue(Scalar):             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */

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":91
 * 
 * 
 * cdef class Int8Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":133
 * 
 * 
 * cdef class Int64Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":306
 * 
 * 
 * cdef class ListValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */

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":376
 * 
 * 
 * cdef class StructValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 */

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":342
 * 
 * 
 * cdef class UnionValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     cdef void _set_array(self, const shared_ptr[CArray]& sp_array):
 */

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":287
 * 
 * 
 * cdef class StringValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":361
 * 
 * 
 * cdef class FixedSizeBinaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":340
 * 
 * 
 * cdef class Array:             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */

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/array.pxi":713
 * 
 * 
 * cdef class Tensor:             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */

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/array.pxi":819
 * 
 * 
 * cdef class NullArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":823
 * 
 * 
 * cdef class BooleanArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":827
 * 
 * 
 * cdef class NumericArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":831
 * 
 * 
 * cdef class IntegerArray(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":835
 * 
 * 
 * cdef class FloatingPointArray(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":839
 * 
 * 
 * cdef class Int8Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":843
 * 
 * 
 * cdef class UInt8Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":847
 * 
 * 
 * cdef class Int16Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":851
 * 
 * 
 * cdef class UInt16Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":855
 * 
 * 
 * cdef class Int32Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":859
 * 
 * 
 * cdef class UInt32Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":863
 * 
 * 
 * cdef class Int64Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":867
 * 
 * 
 * cdef class UInt64Array(IntegerArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":891
 * 
 * 
 * cdef class HalfFloatArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":895
 * 
 * 
 * cdef class FloatArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":899
 * 
 * 
 * cdef class DoubleArray(FloatingPointArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":903
 * 
 * 
 * cdef class FixedSizeBinaryArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":907
 * 
 * 
 * cdef class Decimal128Array(FixedSizeBinaryArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":1129
 * 
 * 
 * cdef class StructArray(Array):             # <<<<<<<<<<<<<<
 * 
 *     def field(self, index):
 */

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":911
 * 
 * 
 * cdef class ListArray(Array):             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */

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":941
 * 
 * 
 * cdef class UnionArray(Array):             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */

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":994
 * 
 * 
 * cdef class StringArray(Array):             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */

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":1032
 * 
 * 
 * cdef class BinaryArray(Array):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":1036
 * 
 * 
 * cdef class DictionaryArray(Array):             # <<<<<<<<<<<<<<
 * 
 *     def dictionary_encode(self):
 */

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/table.pxi":31
 * 
 * 
 * cdef class ChunkedArray:             # <<<<<<<<<<<<<<
 *     """
 *     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":382
 * 
 * 
 * cdef class Column:             # <<<<<<<<<<<<<<
 *     """
 *     Named vector of elements of equal type.
 */

struct __pyx_vtabstruct_7pyarrow_3lib_Column {
  void (*init)(struct __pyx_obj_7pyarrow_3lib_Column *, std::shared_ptr< arrow::Column>  const &);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Column *__pyx_vtabptr_7pyarrow_3lib_Column;


/* "pyarrow/table.pxi":1028
 * 
 * 
 * cdef class Table:             # <<<<<<<<<<<<<<
 *     """
 *     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":690
 * 
 * 
 * cdef class RecordBatch:             # <<<<<<<<<<<<<<
 *     """
 *     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":725
 * 
 * 
 * cdef class Buffer:             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

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":875
 * 
 * 
 * cdef class ResizableBuffer(Buffer):             # <<<<<<<<<<<<<<
 * 
 *     cdef void init_rz(self, const shared_ptr[CResizableBuffer]& buffer):
 */

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":45
 * 
 * 
 * cdef class NativeFile:             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile {
  PyObject *(*read_handle)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr<arrow::io::RandomAccessFile>  *);
  PyObject *(*write_handle)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr<arrow::io::OutputStream>  *);
};
static struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *__pyx_vtabptr_7pyarrow_3lib_NativeFile;


/* "pyarrow/memory.pxi":43
 * 
 * 
 * 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":56
 * 
 * 
 * cdef class ProxyMemoryPool(MemoryPool):             # <<<<<<<<<<<<<<
 *     """
 *     Derived MemoryPool class 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":206
 * 
 * 
 * cdef class StructType(DataType):             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 */

struct __pyx_vtabstruct_7pyarrow_3lib_StructType {
  struct __pyx_vtabstruct_7pyarrow_3lib_DataType __pyx_base;
};
static struct __pyx_vtabstruct_7pyarrow_3lib_StructType *__pyx_vtabptr_7pyarrow_3lib_StructType;


/* "pyarrow/types.pxi":230
 * 
 * 
 * cdef class UnionType(DataType):             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 */

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/scalar.pxi":84
 * 
 * 
 * cdef class BooleanValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":98
 * 
 * 
 * cdef class UInt8Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":105
 * 
 * 
 * cdef class Int16Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":112
 * 
 * 
 * cdef class UInt16Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":119
 * 
 * 
 * cdef class Int32Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":126
 * 
 * 
 * cdef class UInt32Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":140
 * 
 * 
 * cdef class UInt64Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":147
 * 
 * 
 * cdef class Date32Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":157
 * 
 * 
 * cdef class Date64Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":165
 * 
 * 
 * cdef class Time32Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":180
 * 
 * 
 * cdef class Time64Value(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":229
 * 
 * 
 * cdef class TimestampValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     @property
 */

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":257
 * 
 * 
 * cdef class HalfFloatValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":264
 * 
 * 
 * cdef class FloatValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":271
 * 
 * 
 * cdef class DoubleValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":278
 * 
 * 
 * cdef class DecimalValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":294
 * 
 * 
 * cdef class BinaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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":410
 * 
 * 
 * cdef class DictionaryValue(ArrayValue):             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */

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/array.pxi":871
 * 
 * 
 * cdef class Date32Array(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":875
 * 
 * 
 * cdef class Date64Array(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":879
 * 
 * 
 * cdef class TimestampArray(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":883
 * 
 * 
 * cdef class Time32Array(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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":887
 * 
 * 
 * cdef class Time64Array(NumericArray):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */

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/io.pxi":507
 * 
 * 
 * cdef class PythonFile(NativeFile):             # <<<<<<<<<<<<<<
 *     cdef:
 *         object handle
 */

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":547
 * 
 * 
 * cdef class MemoryMappedFile(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     Supports 'r', 'r+w', 'w' modes
 */

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":655
 * 
 * 
 * cdef class OSFile(NativeFile):             # <<<<<<<<<<<<<<
 *     """
 *     Supports 'r', 'w' modes
 */

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":698
 * 
 * 
 * cdef class FixedSizeBufferWriter(NativeFile):             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, Buffer 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":937
 * 
 * 
 * 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":963
 * 
 * 
 * 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":974
 * 
 * 
 * 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[CHadoopFileSystem] 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":483
 * 
 * 
 * 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":216
 * 
 * 
 * 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);

/* 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);

/* 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);

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

/* 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, int 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 = 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

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

/* 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);

/* PyFloatBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace);
#else
#define __Pyx_PyFloat_DivideObjC(op1, op2, floatval, inplace)\
    ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2)))
    #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);

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

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

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

/* 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));
}

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

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

/* 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);

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

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

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

/* py_dict_items.proto */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);

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

/* CallUnboundCMethod0.proto */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CallUnboundCMethod0(cfunc, self)\
    (likely((cfunc)->func) ?\
        (likely((cfunc)->flag == METH_NOARGS) ?  (*((cfunc)->func))(self, NULL) :\
         (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\
            (PY_VERSION_HEX >= 0x030700A0 ?\
                (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\
                (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\
          (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\
            (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\
            (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ?  ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
               ((cfunc)->flag == METH_VARARGS ?  (*((cfunc)->func))(self, __pyx_empty_tuple) :\
               __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\
        __Pyx__CallUnboundCMethod0(cfunc, self))
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

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

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

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

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

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

/* 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);

/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif

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

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

/* None.proto */
static CYTHON_INLINE int64_t __Pyx_div_int64_t(int64_t, int64_t);

/* 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);
}

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

/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

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

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

/* 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);

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

/* 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);
}

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

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

/* 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);

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

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

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

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

/* 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);

/* 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);

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

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

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

/* 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_enum____arrow_3a__3a_TimeUnit_3a__3a_type(enum  arrow::TimeUnit::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_int8_t(int8_t 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_int32_t(int32_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);

static PyObject* __pyx_convert__to_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions(struct arrow::py::PandasOptions s);
/* 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 long __Pyx_PyInt_As_long(PyObject *);

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

/* CIntFromPy.proto */
static CYTHON_INLINE int32_t __Pyx_PyInt_As_int32_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 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 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_10StructType_init(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self, std::shared_ptr< arrow::DataType>  const &__pyx_v_type); /* 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_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_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_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_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_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_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_6Column_init(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, std::shared_ptr< arrow::Column>  const &__pyx_v_column); /* 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 PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_read_handle(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr<arrow::io::RandomAccessFile>  *__pyx_v_file); /* proto*/
static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_write_handle(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr<arrow::io::OutputStream>  *__pyx_v_file); /* 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 'libc.stdint' */

/* Module declarations from 'libcpp' */

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

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

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

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

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

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

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

/* 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.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 '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 'libcpp.cast' */

/* 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_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_FixedSizeBinaryType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Decimal128Type = 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_Int8Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Int64Value = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ListValue = 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_Array = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Tensor = 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_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_ChunkedArray = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_Column = 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_LoggingMemoryPool = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_ProxyMemoryPool = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_StructType = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_UnionType = 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_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_BinaryValue = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib_DictionaryValue = 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_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__RecordBatchWriter = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib__RecordBatchReader = 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___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_4___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_5___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_6_iterchunks = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_7_itercolumns = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_8_download = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_9_upload = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_10___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_11___iter__ = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple = 0;
static PyTypeObject *__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_13_genexpr = 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__type_aliases = 0;
static PyObject *__pyx_v_7pyarrow_3lib_DATETIME_CONVERSION_FUNCTIONS = 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 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_box_scalar(struct __pyx_obj_7pyarrow_3lib_DataType *, std::shared_ptr< arrow::Array>  const &, int64_t); /*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 PyObject *__pyx_f_7pyarrow_3lib_box_metadata( arrow::KeyValueMetadata 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_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_column(std::shared_ptr< arrow::Column>  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 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::Column>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_column(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*/
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 int __pyx_f_7pyarrow_3lib_convert_metadata(PyObject *, std::shared_ptr< arrow::KeyValueMetadata>  *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__as_type(PyObject *); /*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_ListType *__pyx_f_7pyarrow_3lib_list_(PyObject *, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_f_7pyarrow_3lib_dictionary(struct __pyx_obj_7pyarrow_3lib_DataType *, struct __pyx_obj_7pyarrow_3lib_Array *, int __pyx_skip_dispatch, struct __pyx_opt_args_7pyarrow_3lib_dictionary *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__sequence_to_array(PyObject *, PyObject *, PyObject *, struct __pyx_obj_7pyarrow_3lib_DataType *,  arrow::MemoryPool *, bool); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__is_array_like(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__ndarray_to_array(PyObject *, PyObject *, struct __pyx_obj_7pyarrow_3lib_DataType *, bool, bool,  arrow::MemoryPool *); /*proto*/
static CYTHON_INLINE struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_f_7pyarrow_3lib__ensure_type(PyObject *); /*proto*/
static Py_ssize_t __pyx_f_7pyarrow_3lib__normalize_index(Py_ssize_t, Py_ssize_t); /*proto*/
static  arrow::compute::FunctionContext *__pyx_f_7pyarrow_3lib__context(void); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_wrap_datum( arrow::compute::Datum const &); /*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 PyObject *__pyx_f_7pyarrow_3lib_get_series_values(PyObject *); /*proto*/
static std::shared_ptr< arrow::KeyValueMetadata const >  __pyx_f_7pyarrow_3lib_unbox_metadata(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib__schema_from_arrays(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 enum  arrow::Compression::type __pyx_f_7pyarrow_3lib__get_compression_type(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib_get_input_stream(PyObject *, std::shared_ptr<arrow::io::InputStream>  *); /*proto*/
__PYX_EXTERN_C int pyarrow_is_buffer(PyObject *); /*proto*/
__PYX_EXTERN_C int pyarrow_is_data_type(PyObject *); /*proto*/
__PYX_EXTERN_C int pyarrow_is_field(PyObject *); /*proto*/
__PYX_EXTERN_C int pyarrow_is_schema(PyObject *); /*proto*/
__PYX_EXTERN_C int pyarrow_is_array(PyObject *); /*proto*/
__PYX_EXTERN_C PyObject *pyarrow_wrap_chunked_array(std::shared_ptr< arrow::ChunkedArray>  const &); /*proto*/
__PYX_EXTERN_C int pyarrow_is_tensor(PyObject *); /*proto*/
__PYX_EXTERN_C int pyarrow_is_column(PyObject *); /*proto*/
__PYX_EXTERN_C int pyarrow_is_table(PyObject *); /*proto*/
__PYX_EXTERN_C int pyarrow_is_batch(PyObject *); /*proto*/
static PyObject *__pyx_f_7pyarrow_3lib___pyx_unpickle_SerializationContext__set_state(struct __pyx_obj_7pyarrow_3lib_SerializationContext *, PyObject *); /*proto*/
static struct arrow::py::PandasOptions __pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions(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_unordered_map_to_py_std_3a__3a_string____std_3a__3a_string(std::unordered_map<std::string,std::string>  const &); /*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::unordered_set<std::string>  __pyx_convert_unordered_set_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_IOError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_NotImplemented;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_BufferError;
static PyObject *__pyx_builtin_SystemError;
static PyObject *__pyx_builtin_FutureWarning;
static const char __pyx_k_B[] = "B";
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_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_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_w[] = "w";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_NA[] = "NA";
static const char __pyx_k__8[] = "=";
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_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_ms[] = "ms";
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__12[] = "+";
static const char __pyx_k__13[] = "-";
static const char __pyx_k__75[] = "*";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_arr[] = "arr";
static const char __pyx_k_buf[] = "buf";
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_doc[] = "__doc__";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_key[] = "key";
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_six[] = "six";
static const char __pyx_k_str[] = "__str__";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_utc[] = "utc";
static const char __pyx_k_zip[] = "zip";
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__103[] = "\n{}";
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_carr[] = "_carr";
static const char __pyx_k_cast[] = "cast";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_date[] = "date";
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_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_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_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_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_arr_2[] = "_arr";
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_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_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_loads[] = "loads";
static const char __pyx_k_lower[] = "lower";
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_sleep[] = "sleep";
static const char __pyx_k_slice[] = "slice";
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_Buffer[] = "Buffer";
static const char __pyx_k_Column[] = "Column";
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_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_name[] = "c_name";
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_column[] = "column";
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_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_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_insert[] = "insert";
static const char __pyx_k_lambda[] = "<lambda>";
static const char __pyx_k_length[] = "length";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "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_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_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_unique[] = "unique";
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_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_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_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_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_float16[] = "float16";
static const char __pyx_k_float32[] = "float32";
static const char __pyx_k_float64[] = "float64";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_indices[] = "indices";
static const char __pyx_k_libhdfs[] = "libhdfs";
static const char __pyx_k_message[] = "message";
static const char __pyx_k_minutes[] = "_minutes";
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_pyarrow[] = "pyarrow.{}\n{}";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_seconds[] = "seconds";
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_weakref[] = "weakref";
static const char __pyx_k_DataType[] = "DataType";
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_NullType[] = "NullType";
static const char __pyx_k_StringIO[] = "StringIO";
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_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_download[] = "download";
static const char __pyx_k_exc_info[] = "exc_info";
static const char __pyx_k_exc_type[] = "exc_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_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_pdcompat[] = "pdcompat";
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_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_truncate[] = "truncate";
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_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_ordered[] = "c_ordered";
static const char __pyx_k_chunksize[] = "chunksize";
static const char __pyx_k_cpu_count[] = "cpu_count";
static const char __pyx_k_cy_schema[] = "cy_schema";
static const char __pyx_k_date64_ms[] = "date64[ms]";
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_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_halffloat[] = "halffloat";
static const char __pyx_k_in_stream[] = "in_stream";
static const char __pyx_k_indices_2[] = "_indices";
static const char __pyx_k_iteritems[] = "iteritems";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_minutes_2[] = "minutes";
static const char __pyx_k_offsets_2[] = "_offsets";
static const char __pyx_k_precision[] = "precision";
static const char __pyx_k_py_buffer[] = "py_buffer";
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_column[] = "sp_column";
static const char __pyx_k_sp_tensor[] = "sp_tensor";
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_unit_code[] = "unit_code";
static const char __pyx_k_ArrayValue[] = "ArrayValue";
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_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_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_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_compressor[] = "compressor";
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_extra_conf[] = "extra_conf";
static const char __pyx_k_from_array[] = "from_array";
static const char __pyx_k_from_dense[] = "from_dense";
static const char __pyx_k_from_numpy[] = "from_numpy";
static const char __pyx_k_frombuffer[] = "frombuffer";
static const char __pyx_k_getnewargs[] = "__getnewargs__";
static const char __pyx_k_index_type[] = "index_type";
static const char __pyx_k_iterchunks[] = "iterchunks";
static const char __pyx_k_memory_map[] = "memory_map";
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_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_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_tz_convert[] = "tz_convert";
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_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_ImportError[] = "ImportError";
static const char __pyx_k_MemoryError[] = "MemoryError";
static const char __pyx_k_OrderedDict[] = "OrderedDict";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_RecordBatch[] = "RecordBatch";
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_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_boxed_field[] = "boxed_field";
static const char __pyx_k_buffer_size[] = "buffer_size";
static const char __pyx_k_child_field[] = "child_field";
static const char __pyx_k_collections[] = "collections";
static const char __pyx_k_deserialize[] = "deserialize";
static const char __pyx_k_dict_values[] = "dict_values";
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_sparse[] = "from_sparse";
static const char __pyx_k_index_value[] = "index_value";
static const char __pyx_k_itercolumns[] = "itercolumns";
static const char __pyx_k_kerb_ticket[] = "kerb_ticket";
static const char __pyx_k_memory_pool[] = "memory_pool";
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_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_total_bytes[] = "total_bytes";
static const char __pyx_k_tz_localize[] = "tz_localize";
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_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_NumericArray[] = "NumericArray";
static const char __pyx_k_PandasSeries[] = "PandasSeries";
static const char __pyx_k_PickleBuffer[] = "PickleBuffer";
static const char __pyx_k_Type_DECIMAL[] = "Type_DECIMAL";
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_get_capacity[] = "get_capacity";
static const char __pyx_k_have_libhdfs[] = "have_libhdfs";
static const char __pyx_k_is_primitive[] = "_is_primitive";
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_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_serialize_to[] = "serialize_to";
static const char __pyx_k_sp_data_type[] = "sp_data_type";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_string_types[] = "string_types";
static const char __pyx_k_stringsource[] = "stringsource";
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_uncompressed[] = "uncompressed";
static const char __pyx_k_write_tensor[] = "write_tensor";
static const char __pyx_k_ArrowKeyError[] = "ArrowKeyError";
static const char __pyx_k_FeatherReader[] = "FeatherReader";
static const char __pyx_k_FeatherWriter[] = "FeatherWriter";
static const char __pyx_k_FutureWarning[] = "FutureWarning";
static const char __pyx_k_HdfsFileNanny[] = "_HdfsFileNanny";
static const char __pyx_k_MessageReader[] = "MessageReader";
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_array_line_87[] = "array (line 87)";
static const char __pyx_k_c_null_bitmap[] = "c_null_bitmap";
static const char __pyx_k_chunked_array[] = "chunked_array";
static const char __pyx_k_concat_tables[] = "concat_tables";
static const char __pyx_k_datetime64_ns[] = "datetime64[ns]";
static const char __pyx_k_field_or_name[] = "field_or_name";
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_last_accessed[] = "last_accessed";
static const char __pyx_k_last_modified[] = "last_modified";
static const char __pyx_k_output_buffer[] = "output_buffer";
static const char __pyx_k_output_length[] = "output_length";
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_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_value_offsets[] = "value_offsets";
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_DictionaryType[] = "DictionaryType";
static const char __pyx_k_HalfFloatArray[] = "HalfFloatArray";
static const char __pyx_k_HalfFloatValue[] = "HalfFloatValue";
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_builtin_pickle[] = "builtin_pickle";
static const char __pyx_k_check_metadata[] = "check_metadata";
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_foreign_buffer[] = "foreign_buffer";
static const char __pyx_k_get_space_used[] = "get_space_used";
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_stream_or_path[] = "stream_or_path";
static const char __pyx_k_stringify_path[] = "_stringify_path";
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_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_PlasmaStoreFull[] = "PlasmaStoreFull";
static const char __pyx_k_ProxyMemoryPool[] = "ProxyMemoryPool";
static const char __pyx_k_ResizableBuffer[] = "ResizableBuffer";
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_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_writable[] = "_assert_writable";
static const char __pyx_k_children_fields[] = "children_fields";
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_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_multiprocessing[] = "multiprocessing";
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_to_pandas_dtype[] = "to_pandas_dtype";
static const char __pyx_k_ArrowMemoryError[] = "ArrowMemoryError";
static const char __pyx_k_HadoopFileSystem[] = "HadoopFileSystem";
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_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_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_last_access_time[] = "last_access_time";
static const char __pyx_k_number_of_arrays[] = "number_of_arrays";
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_utcfromtimestamp[] = "utcfromtimestamp";
static const char __pyx_k_LoggingMemoryPool[] = "LoggingMemoryPool";
static const char __pyx_k_RecordBatchReader[] = "_RecordBatchReader";
static const char __pyx_k_RecordBatchWriter[] = "_RecordBatchWriter";
static const char __pyx_k_StructType___iter[] = "StructType.__iter__";
static const char __pyx_k_Table_itercolumns[] = "Table.itercolumns";
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_dictionary_encode[] = "dictionary_encode";
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_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_ArrowCapacityError[] = "ArrowCapacityError";
static const char __pyx_k_BufferOutputStream[] = "BufferOutputStream";
static const char __pyx_k_Column_r_not_found[] = "Column {!r} not found";
static const char __pyx_k_FloatingPointArray[] = "FloatingPointArray";
static const char __pyx_k_Invalid_comparison[] = "Invalid comparison";
static const char __pyx_k_PlasmaObjectExists[] = "PlasmaObjectExists";
static const char __pyx_k_SerializedPyObject[] = "SerializedPyObject";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_default_block_size[] = "default_block_size";
static const char __pyx_k_last_modified_time[] = "last_modified_time";
static const char __pyx_k_num_record_batches[] = "num_record_batches";
static const char __pyx_k_pyarrow_memory_pxi[] = "pyarrow/memory.pxi";
static const char __pyx_k_strip_hdfs_abspath[] = "strip_hdfs_abspath";
static const char __pyx_k_Array_cast_line_360[] = "Array.cast (line 360)";
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_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_categorical_columns[] = "categorical_columns";
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_default_memory_pool[] = "default_memory_pool";
static const char __pyx_k_get_datetimetz_type[] = "get_datetimetz_type";
static const char __pyx_k_index_out_of_bounds[] = "index out of bounds";
static const char __pyx_k_pyarrow_io_hdfs_pxi[] = "pyarrow/io-hdfs.pxi";
static const char __pyx_k_set_memcopy_threads[] = "set_memcopy_threads";
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_UnsupportedOperation[] = "UnsupportedOperation";
static const char __pyx_k_arrays_list_is_empty[] = "arrays list is empty";
static const char __pyx_k_integer_object_nulls[] = "integer_object_nulls";
static const char __pyx_k_ChunkedArray_was_NULL[] = "ChunkedArray was NULL";
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_RecordBatchFileReader[] = "_RecordBatchFileReader";
static const char __pyx_k_RecordBatchFileWriter[] = "_RecordBatchFileWriter";
static const char __pyx_k_get_record_batch_size[] = "get_record_batch_size";
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_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_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_size_binary_type[] = "fixed_size_binary_type";
static const char __pyx_k_log_memory_allocations[] = "log_memory_allocations";
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_ArrowSerializationError[] = "ArrowSerializationError";
static const char __pyx_k_ChunkedArray_iterchunks[] = "ChunkedArray.iterchunks";
static const char __pyx_k_Invalid_TimeUnit_string[] = "Invalid TimeUnit string";
static const char __pyx_k_PlasmaObjectNonexistent[] = "PlasmaObjectNonexistent";
static const char __pyx_k_download_locals_cleanup[] = "download.<locals>.cleanup";
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_Column_name_0_r_type_1_r[] = "<Column name={0!r} type={1!r}>";
static const char __pyx_k_RecordBatchReader___iter[] = "_RecordBatchReader.__iter__";
static const char __pyx_k_download_locals_bg_write[] = "download.<locals>.bg_write";
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_Invalid_value_of_whence_0[] = "Invalid value of whence: {0}";
static const char __pyx_k_pyarrow_serialization_pxi[] = "pyarrow/serialization.pxi";
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_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_Native_file_is_not_readable[] = "Native file is not readable";
static const char __pyx_k_Native_file_is_not_writable[] = "Native file is not writable";
static const char __pyx_k_Offset_must_be_non_negative[] = "Offset must be non-negative";
static const char __pyx_k_Table_from_pandas_line_1166[] = "Table.from_pandas (line 1166)";
static const char __pyx_k_Unsupported_type_for_column[] = "Unsupported type for column(...): {}";
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_Names_are_currently_required[] = "Names are currently required";
static const char __pyx_k_benchmark_PandasObjectIsNull[] = "benchmark_PandasObjectIsNull";
static const char __pyx_k_only_valid_on_readonly_files[] = "only valid on readonly files";
static const char __pyx_k_only_valid_on_writable_files[] = "only valid on writable files";
static const char __pyx_k_Cannot_pass_schema_and_arrays[] = "Cannot pass schema and arrays";
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_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        preserve_index : bool, optional\n            Whether to store the index as an additional column in the resulting\n            ``Table``.\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        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.Tab""le object at 0x7f05d1fb1b40>\n        ";
static const char __pyx_k_pyx_unpickle_SerializationCont[] = "__pyx_unpickle_SerializationContext";
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_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 False\n        Use pandas's semantics for inferring nulls from values in ndarray-like\n        data. If passed, the mask tasks precendence, but if a value is unmasked\n        (not-null), but still null according to pandas semantics, then it is\n        null\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    <py""arrow.array.Int64Array object at 0x7f9019e11208>\n    [\n      1,\n      null\n    ]\n\n    Returns\n    -------\n    array : pyarrow.Array or pyarrow.ChunkedArray (if object data\n    overflowed binary storage)\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_File_object_is_malformed_has_no[] = "File object is malformed, has no mode";
static const char __pyx_k_List_requires_DataType_or_Field[] = "List requires DataType or Field";
static const char __pyx_k_Must_pass_decompressed_size_for[] = "Must pass decompressed_size for {0} codec";
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_Unrecognized_compression_type_0[] = "Unrecognized compression type: {0}";
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_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_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_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_type_s_not_supported_for_buffer[] = "type %s not supported for buffer protocol";
static const char __pyx_k_All_arrays_must_have_the_same_le[] = "All arrays must have the same length";
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_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_Column_s_constructor[] = "Do not call Column's constructor directly, use one of the `Column.from_*` functions 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_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";
static const char __pyx_k_HDFS_client_improperly_initializ[] = "HDFS client improperly initialized";
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_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_names_when_constructin[] = "Must pass names when constructing from Array objects";
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_No_value_specified_for_struct_at[] = "No value specified for struct attribute 'strings_to_categorical'";
static const char __pyx_k_NumPy_array_view_is_only_support[] = "NumPy array view is only supported for arrays without nulls.";
static const char __pyx_k_Passed_field_type_does_not_match[] = "Passed field type does not match array";
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_Record_batch_column_index_d_is_o[] = "Record batch column index {:d} is out of range";
static const char __pyx_k_Schema_and_number_of_arrays_uneq[] = "Schema and number of arrays unequal";
static const char __pyx_k_SerializationCallbackError___ini[] = "SerializationCallbackError.__init__";
static const char __pyx_k_StringBuilder_only_accepts_strin[] = "StringBuilder only accepts string objects";
static const char __pyx_k_Table_column_index_d_is_out_of_r[] = "Table column index {:d} is out of range";
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_could_not_infer_open_mode_for_fi[] = "could not infer open mode for file-like object %r, please pass it explicitly";
static const char __pyx_k_from_buffers_is_only_supported_f[] = "from_buffers is only supported for primitive arrays yet.";
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_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_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_self_data_cannot_be_converted_to[] = "self.data 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_tensor_self_tp_cannot_be[] = "self.sp_tensor,self.tp cannot be converted to a Python object for pickling";
static const char __pyx_k_trying_to_write_an_immutable_buf[] = "trying to write an immutable buffer";
static const char __pyx_k_Do_not_call_s_constructor_direct_2[] = "Do not call {}'s constructor directly. Use pyarrow.proxy_memory_pool instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_3[] = "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_4[] = "Do not call {}'s constructor directly, use array subscription instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_5[] = "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_6[] = "Do not call {}'s constructor directly, use `pyarrow.ipc.read_message` function instead.";
static const char __pyx_k_Do_not_call_s_constructor_direct_7[] = "Do not call {}'s constructor directly, use `pyarrow.ipc.MessageReader.open_stream` function instead.";
static const char __pyx_k_No_value_specified_for_struct_at_2[] = "No value specified for struct attribute 'zero_copy_only'";
static const char __pyx_k_No_value_specified_for_struct_at_3[] = "No value specified for struct attribute 'integer_object_nulls'";
static const char __pyx_k_No_value_specified_for_struct_at_4[] = "No value specified for struct attribute 'date_as_object'";
static const char __pyx_k_No_value_specified_for_struct_at_5[] = "No value specified for struct attribute 'use_threads'";
static const char __pyx_k_NumPy_array_view_is_only_support_2[] = "NumPy array view is only supported for primitive types.";
static PyObject *__pyx_kp_s_02d_02d;
static PyObject *__pyx_kp_s_0_0_9_1_0_9_2_0_3_0_5_0_9;
static PyObject *__pyx_kp_s_0_1;
static PyObject *__pyx_kp_s_0___class_____name___0;
static PyObject *__pyx_kp_s_All_arrays_must_have_the_same_le;
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_360;
static PyObject *__pyx_kp_s_Array_data_type_was_NULL;
static PyObject *__pyx_kp_s_Array_was_NULL;
static PyObject *__pyx_kp_s_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_ArrowInvalid;
static PyObject *__pyx_n_s_ArrowKeyError;
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_kp_s_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_n_s_BufferedIOBase;
static PyObject *__pyx_kp_s_CPU_count_must_be_strictly_posit;
static PyObject *__pyx_kp_s_Cannot_compare_Arrow_values_that;
static PyObject *__pyx_kp_s_Cannot_construct_a_chunked_array;
static PyObject *__pyx_kp_s_Cannot_convert_nanosecond_timest;
static PyObject *__pyx_kp_s_Cannot_create_multiple_NAType_in;
static PyObject *__pyx_kp_s_Cannot_pass_schema_and_arrays;
static PyObject *__pyx_kp_u_Cast_array_values_to_another_da;
static PyObject *__pyx_n_s_Categorical;
static PyObject *__pyx_kp_s_Chunk_index_out_of_range;
static PyObject *__pyx_n_s_ChunkedArray;
static PyObject *__pyx_n_s_ChunkedArray___iter;
static PyObject *__pyx_kp_s_ChunkedArray_data_type_was_NULL;
static PyObject *__pyx_n_s_ChunkedArray_iterchunks;
static PyObject *__pyx_kp_s_ChunkedArray_was_NULL;
static PyObject *__pyx_n_s_Column;
static PyObject *__pyx_kp_s_Column_does_not_exist_in_table;
static PyObject *__pyx_kp_s_Column_name_0_r_type_1_r;
static PyObject *__pyx_kp_s_Column_r_not_found;
static PyObject *__pyx_kp_s_Comparisons_with_pyarrow_Array_a;
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_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_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_n_s_DictionaryArray;
static PyObject *__pyx_n_s_DictionaryType;
static PyObject *__pyx_n_s_DictionaryValue;
static PyObject *__pyx_kp_s_Do_not_call_Buffer_s_constructor;
static PyObject *__pyx_kp_s_Do_not_call_ChunkedArray_s_const;
static PyObject *__pyx_kp_s_Do_not_call_Column_s_constructor;
static PyObject *__pyx_kp_s_Do_not_call_Field_s_constructor;
static PyObject *__pyx_kp_s_Do_not_call_RecordBatch_s_constr;
static PyObject *__pyx_kp_s_Do_not_call_Schema_s_constructor;
static PyObject *__pyx_kp_s_Do_not_call_Table_s_constructor;
static PyObject *__pyx_kp_s_Do_not_call_Tensor_s_constructor;
static PyObject *__pyx_kp_s_Do_not_call_s_constructor_direct;
static PyObject *__pyx_kp_s_Do_not_call_s_constructor_direct_2;
static PyObject *__pyx_kp_s_Do_not_call_s_constructor_direct_3;
static PyObject *__pyx_kp_s_Do_not_call_s_constructor_direct_4;
static PyObject *__pyx_kp_s_Do_not_call_s_constructor_direct_5;
static PyObject *__pyx_kp_s_Do_not_call_s_constructor_direct_6;
static PyObject *__pyx_kp_s_Do_not_call_s_constructor_direct_7;
static PyObject *__pyx_n_s_DoubleArray;
static PyObject *__pyx_n_s_DoubleValue;
static PyObject *__pyx_n_s_Empty;
static PyObject *__pyx_n_s_FIXED_OFFSET_RE;
static PyObject *__pyx_kp_s_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_s_File_object_is_malformed_has_no;
static PyObject *__pyx_n_s_FixedOffset;
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_FloatArray;
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_s_HDFS_client_improperly_initializ;
static PyObject *__pyx_kp_s_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_IOError;
static PyObject *__pyx_kp_s_I_O_operation_on_closed_file;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x9a;
static PyObject *__pyx_n_s_Index;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_kp_s_Index_must_either_be_string_or_i;
static PyObject *__pyx_kp_s_Indices_must_be_integer_type;
static PyObject *__pyx_n_s_Int16Array;
static PyObject *__pyx_n_s_Int16Value;
static PyObject *__pyx_n_s_Int32Array;
static PyObject *__pyx_n_s_Int32Value;
static PyObject *__pyx_n_s_Int64Array;
static PyObject *__pyx_n_s_Int64Value;
static PyObject *__pyx_n_s_Int8Array;
static PyObject *__pyx_n_s_Int8Value;
static PyObject *__pyx_n_s_IntegerArray;
static PyObject *__pyx_kp_s_Invalid_TimeUnit_for_time32;
static PyObject *__pyx_kp_s_Invalid_TimeUnit_for_time64;
static PyObject *__pyx_kp_s_Invalid_TimeUnit_string;
static PyObject *__pyx_kp_s_Invalid_comparison;
static PyObject *__pyx_kp_s_Invalid_file_mode_0;
static PyObject *__pyx_kp_s_Invalid_union_mode_0_r;
static PyObject *__pyx_kp_s_Invalid_value_of_whence_0;
static PyObject *__pyx_n_s_K;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_kp_s_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_s_List_requires_DataType_or_Field;
static PyObject *__pyx_n_s_LoggingMemoryPool;
static PyObject *__pyx_n_s_Mapping;
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_n_s_MockOutputStream;
static PyObject *__pyx_kp_s_Mode_must_be_rb_read_wb_write_ne;
static PyObject *__pyx_kp_s_Must_pass_decompressed_size_for;
static PyObject *__pyx_kp_s_Must_pass_names_when_constructin;
static PyObject *__pyx_kp_s_Must_pass_schema_or_at_least_one;
static PyObject *__pyx_n_s_NA;
static PyObject *__pyx_n_s_NAType;
static PyObject *__pyx_n_s_NULL;
static PyObject *__pyx_n_s_NULL_2;
static PyObject *__pyx_kp_s_Names_are_currently_required;
static PyObject *__pyx_n_s_NativeFile;
static PyObject *__pyx_kp_s_Native_file_is_not_readable;
static PyObject *__pyx_kp_s_Native_file_is_not_writable;
static PyObject *__pyx_kp_s_No_type_alias_for_0;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_2;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_3;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_4;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_5;
static PyObject *__pyx_kp_s_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_kp_s_NumPy_array_view_is_only_support;
static PyObject *__pyx_kp_s_NumPy_array_view_is_only_support_2;
static PyObject *__pyx_n_s_NumericArray;
static PyObject *__pyx_n_s_OSFile;
static PyObject *__pyx_kp_s_Offset_must_be_non_negative;
static PyObject *__pyx_n_s_OrderedDict;
static PyObject *__pyx_n_s_PandasSeries;
static PyObject *__pyx_kp_s_Passed_field_type_does_not_match;
static PyObject *__pyx_n_s_PickleBuffer;
static PyObject *__pyx_n_s_PickleError;
static PyObject *__pyx_n_s_PlasmaObjectExists;
static PyObject *__pyx_n_s_PlasmaObjectNonexistent;
static PyObject *__pyx_n_s_PlasmaStoreFull;
static PyObject *__pyx_kp_s_Please_use_read_next_batch_inste;
static PyObject *__pyx_n_s_ProxyMemoryPool;
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_RecordBatchReader;
static PyObject *__pyx_n_s_RecordBatchReader___iter;
static PyObject *__pyx_n_s_RecordBatchWriter;
static PyObject *__pyx_kp_s_Record_batch_column_index_d_is_o;
static PyObject *__pyx_n_s_ResizableBuffer;
static PyObject *__pyx_n_s_Scalar;
static PyObject *__pyx_n_s_Schema;
static PyObject *__pyx_n_s_Schema___iter;
static PyObject *__pyx_kp_s_Schema_and_number_of_arrays_uneq;
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_StopIteration;
static PyObject *__pyx_n_s_StringArray;
static PyObject *__pyx_n_s_StringBuilder;
static PyObject *__pyx_kp_s_StringBuilder_only_accepts_strin;
static PyObject *__pyx_n_s_StringIO;
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_n_s_SystemError;
static PyObject *__pyx_n_s_Table;
static PyObject *__pyx_kp_s_Table_column_index_d_is_out_of_r;
static PyObject *__pyx_kp_u_Table_from_pandas_line_1166;
static PyObject *__pyx_n_s_Table_itercolumns;
static PyObject *__pyx_kp_s_Target_schema_s_field_names_are;
static PyObject *__pyx_n_s_Tensor;
static PyObject *__pyx_kp_s_Tensor_was_NULL;
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_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_FIXED_SIZE_BINARY;
static PyObject *__pyx_n_s_Type_FLOAT;
static PyObject *__pyx_n_s_Type_HALF_FLOAT;
static PyObject *__pyx_kp_s_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_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_n_s_UInt16Array;
static PyObject *__pyx_n_s_UInt16Value;
static PyObject *__pyx_n_s_UInt32Array;
static PyObject *__pyx_n_s_UInt32Value;
static PyObject *__pyx_n_s_UInt64Array;
static PyObject *__pyx_n_s_UInt64Value;
static PyObject *__pyx_n_s_UInt8Array;
static PyObject *__pyx_n_s_UInt8Value;
static PyObject *__pyx_kp_s_Unable_to_read_from_object_of_ty;
static PyObject *__pyx_kp_s_Unable_to_read_message_from_obje;
static PyObject *__pyx_kp_s_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_kp_s_Unrecognized_compression_type_0;
static PyObject *__pyx_n_s_UnsupportedOperation;
static PyObject *__pyx_kp_s_Unsupported_type_for_column;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_s_We_do_not_know_how_to_serialize;
static PyObject *__pyx_kp_s_Writable_buffer_requested_but_Ar;
static PyObject *__pyx_kp_s__103;
static PyObject *__pyx_kp_s__12;
static PyObject *__pyx_kp_s__13;
static PyObject *__pyx_n_s__75;
static PyObject *__pyx_kp_b__8;
static PyObject *__pyx_n_s_ab;
static PyObject *__pyx_kp_s_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_append;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_arr;
static PyObject *__pyx_n_s_arr_2;
static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_array_2;
static PyObject *__pyx_kp_u_array_line_87;
static PyObject *__pyx_n_s_arrays;
static PyObject *__pyx_kp_s_arrays_list_is_empty;
static PyObject *__pyx_n_s_arrow_obj;
static PyObject *__pyx_n_s_as_buffer;
static PyObject *__pyx_n_s_as_py;
static PyObject *__pyx_n_s_asarray;
static PyObject *__pyx_n_s_asbytes;
static PyObject *__pyx_n_s_assert_open;
static PyObject *__pyx_n_s_assert_readable;
static PyObject *__pyx_n_s_assert_writable;
static PyObject *__pyx_n_s_astype;
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_s_binary_type;
static PyObject *__pyx_n_s_bit_width;
static PyObject *__pyx_n_s_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_s_bool_2;
static PyObject *__pyx_n_s_boxed_field;
static PyObject *__pyx_n_s_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_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_codec;
static PyObject *__pyx_n_s_c_fields;
static PyObject *__pyx_n_s_c_meta;
static PyObject *__pyx_n_s_c_name;
static PyObject *__pyx_n_s_c_null_bitmap;
static PyObject *__pyx_n_s_c_ordered;
static PyObject *__pyx_n_s_c_path;
static PyObject *__pyx_n_s_c_result;
static PyObject *__pyx_n_s_c_schema;
static PyObject *__pyx_n_s_c_size;
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_carr;
static PyObject *__pyx_n_s_cast;
static PyObject *__pyx_n_s_cat;
static PyObject *__pyx_n_s_categorical_columns;
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_s_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_s_cls;
static PyObject *__pyx_n_s_codec;
static PyObject *__pyx_n_s_codes;
static PyObject *__pyx_n_s_col;
static PyObject *__pyx_n_s_collections;
static PyObject *__pyx_n_s_column;
static PyObject *__pyx_n_s_column_2;
static PyObject *__pyx_n_s_columns;
static PyObject *__pyx_n_s_compile;
static PyObject *__pyx_n_s_components;
static PyObject *__pyx_n_s_compress;
static PyObject *__pyx_n_s_compressor;
static PyObject *__pyx_n_s_concat_tables;
static PyObject *__pyx_n_s_connect;
static PyObject *__pyx_n_s_context;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_kp_s_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_create;
static PyObject *__pyx_n_s_create_memory_map;
static PyObject *__pyx_n_s_ctensor;
static PyObject *__pyx_n_s_custom_deserializer;
static PyObject *__pyx_n_s_custom_serializer;
static PyObject *__pyx_n_s_cy_schema;
static PyObject *__pyx_n_b_d;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_dataframe_to_arrays;
static PyObject *__pyx_n_s_date;
static PyObject *__pyx_n_s_date32;
static PyObject *__pyx_kp_s_date32_day;
static PyObject *__pyx_n_s_date64;
static PyObject *__pyx_kp_s_date64_ms;
static PyObject *__pyx_n_s_date_as_object;
static PyObject *__pyx_n_s_datetime;
static PyObject *__pyx_kp_s_datetime64_ns;
static PyObject *__pyx_n_s_decimal;
static PyObject *__pyx_n_s_decimal128;
static PyObject *__pyx_n_s_decompress;
static PyObject *__pyx_n_s_decompressed_size;
static PyObject *__pyx_n_s_default_block_size;
static PyObject *__pyx_n_s_default_memory_pool;
static PyObject *__pyx_n_s_default_serialization_context;
static PyObject *__pyx_n_s_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_s_df;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_dict_values;
static PyObject *__pyx_n_s_dictionary;
static PyObject *__pyx_n_s_dictionary_2;
static PyObject *__pyx_n_s_dictionary_encode;
static PyObject *__pyx_n_s_dictionary_value;
static PyObject *__pyx_n_s_directory;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_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_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_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_type;
static PyObject *__pyx_n_s_exc_value;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_extra_conf;
static PyObject *__pyx_n_b_f;
static PyObject *__pyx_n_s_f;
static PyObject *__pyx_n_s_f2;
static PyObject *__pyx_n_s_f4;
static PyObject *__pyx_n_s_f8;
static PyObject *__pyx_n_s_fastpath;
static PyObject *__pyx_n_s_field;
static PyObject *__pyx_n_s_field_or_name;
static PyObject *__pyx_n_s_fields;
static PyObject *__pyx_n_s_fields_2;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_file_descriptor;
static PyObject *__pyx_n_s_file_handle;
static PyObject *__pyx_n_s_fixed_size_binary_type;
static PyObject *__pyx_n_s_float;
static PyObject *__pyx_n_s_float16;
static PyObject *__pyx_n_s_float32;
static PyObject *__pyx_n_s_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_array;
static PyObject *__pyx_n_s_from_arrays;
static PyObject *__pyx_n_s_from_batches;
static PyObject *__pyx_n_s_from_buffers;
static PyObject *__pyx_kp_s_from_buffers_is_only_supported_f;
static PyObject *__pyx_n_s_from_components;
static PyObject *__pyx_n_s_from_dense;
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_sparse;
static PyObject *__pyx_n_s_frombuffer;
static PyObject *__pyx_n_s_frombytes;
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_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_getnewargs;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_getvalue;
static PyObject *__pyx_n_s_group;
static PyObject *__pyx_n_s_gzip;
static PyObject *__pyx_n_b_h;
static PyObject *__pyx_n_s_halffloat;
static PyObject *__pyx_n_s_handle;
static PyObject *__pyx_n_s_have_libhdfs;
static PyObject *__pyx_n_s_have_libhdfs3;
static PyObject *__pyx_kp_s_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_s_i1;
static PyObject *__pyx_n_s_i2;
static PyObject *__pyx_n_s_i4;
static PyObject *__pyx_n_s_i8;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_in_stream;
static PyObject *__pyx_n_s_indent;
static PyObject *__pyx_kp_s_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_s_indices_2;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_insert;
static PyObject *__pyx_n_s_int16;
static PyObject *__pyx_n_s_int32;
static PyObject *__pyx_n_s_int64;
static PyObject *__pyx_n_s_int8;
static PyObject *__pyx_n_s_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_boolean_value;
static PyObject *__pyx_n_s_is_float_value;
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_primitive;
static PyObject *__pyx_n_s_item;
static PyObject *__pyx_n_s_items;
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_join;
static PyObject *__pyx_n_s_json;
static PyObject *__pyx_n_s_kerb_ticket;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_kp_s_key_must_either_be_a_slice_or_in;
static PyObject *__pyx_n_s_kind;
static PyObject *__pyx_n_s_lambda;
static PyObject *__pyx_n_s_last_access_time;
static PyObject *__pyx_n_s_last_accessed;
static PyObject *__pyx_n_s_last_modified;
static PyObject *__pyx_n_s_last_modified_time;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_n_s_libhdfs;
static PyObject *__pyx_n_s_libhdfs3;
static PyObject *__pyx_n_s_list;
static PyObject *__pyx_n_s_loads;
static PyObject *__pyx_n_s_log_memory_allocations;
static PyObject *__pyx_n_s_lower;
static PyObject *__pyx_n_s_lz4;
static PyObject *__pyx_n_s_m;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_make_datetimetz;
static PyObject *__pyx_n_s_map;
static PyObject *__pyx_n_s_mask;
static PyObject *__pyx_kp_s_mask_not_implemented_with_Arrow;
static PyObject *__pyx_n_s_match;
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_message;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_metadata;
static PyObject *__pyx_kp_s_metadata_2;
static PyObject *__pyx_n_s_metadata_length;
static PyObject *__pyx_n_s_microseconds;
static PyObject *__pyx_n_s_milliseconds;
static PyObject *__pyx_n_s_minutes;
static PyObject *__pyx_n_s_minutes_2;
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_s_ms;
static PyObject *__pyx_n_s_multiprocessing;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_names;
static PyObject *__pyx_n_s_nan;
static PyObject *__pyx_n_s_nbytes;
static PyObject *__pyx_n_s_ndarray;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_new_path;
static PyObject *__pyx_n_s_new_size;
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
static PyObject *__pyx_n_s_normalize_slice;
static PyObject *__pyx_kp_s_not_registered_in_deserializati;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_s_ns;
static PyObject *__pyx_n_s_nthreads;
static PyObject *__pyx_n_s_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_s_num_children;
static PyObject *__pyx_n_s_num_chunks;
static PyObject *__pyx_n_s_num_columns;
static PyObject *__pyx_n_s_num_record_batches;
static PyObject *__pyx_n_s_num_rows;
static PyObject *__pyx_n_s_num_tensors;
static PyObject *__pyx_n_s_number_of_arrays;
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_s_only_slices_with_step_1_supporte;
static PyObject *__pyx_kp_s_only_valid_on_readonly_files;
static PyObject *__pyx_kp_s_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_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_owner;
static PyObject *__pyx_n_s_pa_getnewargs;
static PyObject *__pyx_n_s_pandas;
static PyObject *__pyx_n_s_parent;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_pd;
static PyObject *__pyx_n_s_pdcompat;
static PyObject *__pyx_n_s_permissions;
static PyObject *__pyx_n_s_pformat;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_n_s_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_n_s_prepare;
static PyObject *__pyx_n_s_preserve_index;
static PyObject *__pyx_kp_s_prior_column_had_a_different_num;
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_s_pyarrow;
static PyObject *__pyx_kp_s_pyarrow_Field_0;
static PyObject *__pyx_kp_s_pyarrow_Message_type_0_metadata;
static PyObject *__pyx_kp_s_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_does_not_know_how_to_ser;
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_serialization_pxi;
static PyObject *__pyx_kp_s_pyarrow_table_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_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_SerializationCont;
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_s_r;
static PyObject *__pyx_kp_s_r_2;
static PyObject *__pyx_kp_s_r_b;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_kp_s_rb;
static PyObject *__pyx_n_s_rb_2;
static PyObject *__pyx_n_s_re;
static PyObject *__pyx_n_s_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_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_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_remove_column;
static PyObject *__pyx_n_s_replace;
static PyObject *__pyx_n_s_replication;
static PyObject *__pyx_n_s_repr;
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_rz_buffer;
static PyObject *__pyx_n_s_s;
static PyObject *__pyx_n_s_safe;
static PyObject *__pyx_n_s_scale;
static PyObject *__pyx_n_s_schema;
static PyObject *__pyx_n_s_seconds;
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_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_sp_array_cannot_be_converte;
static PyObject *__pyx_kp_s_self_sp_tensor_self_tp_cannot_be;
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_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_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_s_sleep;
static PyObject *__pyx_n_s_slice;
static PyObject *__pyx_n_s_snappy;
static PyObject *__pyx_n_s_source;
static PyObject *__pyx_n_s_sp_chunked_array;
static PyObject *__pyx_n_s_sp_column;
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_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_str;
static PyObject *__pyx_n_s_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_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_kp_s_stringsource;
static PyObject *__pyx_n_s_strip_hdfs_abspath;
static PyObject *__pyx_n_s_struct;
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_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_tensor;
static PyObject *__pyx_n_s_test;
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_s_time32_ms;
static PyObject *__pyx_kp_s_time32_s;
static PyObject *__pyx_n_s_time64;
static PyObject *__pyx_kp_s_time64_ns;
static PyObject *__pyx_kp_s_time64_us;
static PyObject *__pyx_n_s_timedelta;
static PyObject *__pyx_n_s_timeout;
static PyObject *__pyx_n_s_timestamp;
static PyObject *__pyx_kp_s_timestamp_ms;
static PyObject *__pyx_kp_s_timestamp_ns;
static PyObject *__pyx_kp_s_timestamp_s;
static PyObject *__pyx_kp_s_timestamp_us;
static PyObject *__pyx_n_s_timezone;
static PyObject *__pyx_n_s_to_pandas;
static PyObject *__pyx_n_s_to_pandas_dtype;
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_truncate;
static PyObject *__pyx_kp_s_trying_to_write_an_immutable_buf;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_n_s_type_2;
static PyObject *__pyx_n_s_type_3;
static PyObject *__pyx_n_s_type_codes;
static PyObject *__pyx_n_s_type_for_alias;
static PyObject *__pyx_n_s_type_id;
static PyObject *__pyx_kp_s_type_s_not_supported_for_buffer;
static PyObject *__pyx_n_s_types;
static PyObject *__pyx_n_s_tz;
static PyObject *__pyx_n_s_tz_convert;
static PyObject *__pyx_n_s_tz_localize;
static PyObject *__pyx_n_s_tzinfo;
static PyObject *__pyx_n_s_tzinfo_to_string;
static PyObject *__pyx_n_s_u1;
static PyObject *__pyx_n_s_u2;
static PyObject *__pyx_n_s_u4;
static PyObject *__pyx_n_s_u8;
static PyObject *__pyx_n_s_uint16;
static PyObject *__pyx_n_s_uint32;
static PyObject *__pyx_n_s_uint64;
static PyObject *__pyx_n_s_uint8;
static PyObject *__pyx_n_s_uncompressed;
static PyObject *__pyx_n_s_union;
static PyObject *__pyx_n_s_union_type;
static PyObject *__pyx_n_s_unique;
static PyObject *__pyx_n_s_unit;
static PyObject *__pyx_n_s_unit_code;
static PyObject *__pyx_kp_s_unknown_driver_r;
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_s_us;
static PyObject *__pyx_n_s_use_memory_map;
static PyObject *__pyx_n_s_use_threads;
static PyObject *__pyx_n_s_user;
static PyObject *__pyx_n_s_utc;
static PyObject *__pyx_n_s_utcfromtimestamp;
static PyObject *__pyx_n_s_utf8;
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_w;
static PyObject *__pyx_n_s_warn;
static PyObject *__pyx_n_s_warnings;
static PyObject *__pyx_n_s_wb;
static PyObject *__pyx_n_s_weakref;
static PyObject *__pyx_n_s_whence;
static PyObject *__pyx_n_s_window;
static PyObject *__pyx_n_s_wrapped_value;
static PyObject *__pyx_n_s_writable;
static PyObject *__pyx_n_s_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_x;
static PyObject *__pyx_n_s_zero_copy_only;
static PyObject *__pyx_n_s_zip;
static PyObject *__pyx_n_s_zone;
static PyObject *__pyx_n_s_zstd;
static PyObject *__pyx_lambda_funcdef_7pyarrow_3lib_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_lambda_funcdef_7pyarrow_3lib_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_lambda_funcdef_7pyarrow_3lib_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_lambda_funcdef_7pyarrow_3lib_lambda3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_lambda_funcdef_7pyarrow_3lib_lambda4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_lambda_funcdef_7pyarrow_3lib_lambda5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo); /* proto */
static PyObject *__pyx_lambda_funcdef_7pyarrow_3lib_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo); /* proto */
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_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_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10MemoryPool_6__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 int __pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_2__cinit__(struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_6__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_8set_memory_pool(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10log_memory_allocations(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_enable); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12total_allocated_bytes(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_14_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_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 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_10dictionary___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 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_10StructType_12num_children___get__(struct __pyx_obj_7pyarrow_3lib_StructType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_12num_children___get__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_9UnionType_4mode___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_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 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_18remove_metadata(struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Field_20flatten(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 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_13__eq__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_15empty_table(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_17equals(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_check_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_19field_by_name(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_21get_field_index(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_23append(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_25insert(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_27remove(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_29set(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_31add_metadata(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_33serialize(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_35remove_metadata(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_37__str__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_39__repr__(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_16field(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_18null(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_20bool_(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22uint8(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_24int8(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_26uint16(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_28int16(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_30uint32(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_32int32(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_34uint64(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_36int64(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_38tzinfo_to_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_40string_to_tzinfo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_42timestamp(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit, PyObject *__pyx_v_tz); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_44time32(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_46time64(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_unit); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_48date32(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_50date64(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_52float16(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_54float32(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_56float64(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_58decimal128(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_precision, int __pyx_v_scale); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_60string(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_62binary(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_length); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_64list_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_66dictionary(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_index_type, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_dict_values, int __pyx_v_ordered); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_68struct(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fields); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_70union(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_children_fields, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_72type_for_alias(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_74schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fields, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_76from_numpy_dtype(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dtype); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_78is_boolean_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_80is_integer_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_82is_float_value(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* 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__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NullType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_8NullType_8__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_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_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_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_StringValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11StringValue_4__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_11BinaryValue_as_py(struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BinaryValue *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11BinaryValue_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_BinaryValue *__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 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 PyObject *__pyx_pf_7pyarrow_3lib_84array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type, PyObject *__pyx_v_mask, PyObject *__pyx_v_size, 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_86asarray(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_values, PyObject *__pyx_v_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_88_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_90_restore_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* 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_6cast(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_8unique(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_10dictionary_encode(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_12from_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_14__reduce__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_16from_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); /* 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_18__iter__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_21__repr__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_23format(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_25__str__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_27equals(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_29__len__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_31isnull(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_33__getitem__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_35slice(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_37to_pandas(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, int __pyx_v_strings_to_categorical, int __pyx_v_zero_copy_only, int __pyx_v_integer_object_nulls, int __pyx_v_date_as_object); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_39__array__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_dtype); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_41to_numpy(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_43to_pylist(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Array_45validate(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self); /* 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_47buffers(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 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); /* 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_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_12__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_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* 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_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); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10UnionArray_2from_sparse(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_types, PyObject *__pyx_v_children); /* 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_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); /* 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_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_10null_count___get__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_16__iter__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_19__getitem__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_21equals(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_23to_pandas(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, int __pyx_v_strings_to_categorical, int __pyx_v_zero_copy_only, int __pyx_v_integer_object_nulls, int __pyx_v_date_as_object); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_25__array__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_dtype); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_27dictionary_encode(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_29unique(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_31slice(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_33chunk(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_35iterchunks(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_38to_pylist(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_92chunked_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays, PyObject *__pyx_v_type); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_94column(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_field_or_name, PyObject *__pyx_v_arr); /* proto */
static int __pyx_pf_7pyarrow_3lib_6Column___cinit__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_6Column_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_4__reduce__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_6__repr__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_8__richcmp__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_other, int __pyx_v_op); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_10__getitem__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_12from_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_14cast(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, PyObject *__pyx_v_target_type, int __pyx_v_safe); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_16dictionary_encode(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_18unique(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_20flatten(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_22to_pandas(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, int __pyx_v_strings_to_categorical, int __pyx_v_zero_copy_only, int __pyx_v_integer_object_nulls, int __pyx_v_date_as_object); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_24__array__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, PyObject *__pyx_v_dtype); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_26equals(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_28to_pylist(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Column_30__len__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_32length(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_5field___get__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_5shape___get__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_10null_count___get__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_4name___get__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_4type___get__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Column_4data___get__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self); /* 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_8replace_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_10column(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_12__getitem__(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_14serialize(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, PyObject *__pyx_v_memory_pool); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_16slice(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_18equals(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_20to_pydict(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_22to_pandas(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__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); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_24from_pandas(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, int __pyx_v_preserve_index, PyObject *__pyx_v_nthreads, PyObject *__pyx_v_columns); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_11RecordBatch_26from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_96_reconstruct_record_batch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_columns, PyObject *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_98table_to_blocks(CYTHON_UNUSED PyObject *__pyx_self, struct arrow::py::PandasOptions __pyx_v_options, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool, PyObject *__pyx_v_categories); /* 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_6_validate(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self); /* 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_10replace_schema_metadata(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_metadata); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_12flatten(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_14equals(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_16cast(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_18from_pandas(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, int __pyx_v_preserve_index, PyObject *__pyx_v_nthreads, PyObject *__pyx_v_columns, int __pyx_v_safe); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_20from_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_22from_batches(PyObject *__pyx_v_batches, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_24to_batches(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_chunksize); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_26to_pandas(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__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); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_28to_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_30column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_32_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_34__getitem__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_36itercolumns(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_39__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_41add_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i, struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_column); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_43append_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_column); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_45remove_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_47set_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i, struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_column); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_5Table_49drop(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_columns); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_100_reconstruct_table(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_arrays, PyObject *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_102concat_tables(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tables); /* 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_18close(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_20flush(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_22_assert_open(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_24_assert_readable(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_26_assert_writable(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_34write(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_36read(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_38read1(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_nbytes); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_40readall(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_42readinto(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_44readline(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_46readlines(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_48__iter__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_50__next__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_52read_buffer(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_nbytes); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_54truncate(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_56writelines(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_58download(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_60upload(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_6closed___get__(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_62__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_64__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_104memory_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path, PyObject *__pyx_v_mode); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_106create_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_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_6__getitem__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_8slice(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_10equals(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_12__eq__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_14__reduce_ex__(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self, PyObject *__pyx_v_protocol); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_6Buffer_16to_pybytes(struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_self); /* proto */
static int __pyx_pf_7pyarrow_3lib_6Buffer_18__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_20__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_22__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_24__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_108allocate_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 PyObject *__pyx_pf_7pyarrow_3lib_110py_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_112foreign_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_114as_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_o); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_116compress(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_118decompress(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_120have_libhdfs(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_122have_libhdfs3(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_124strip_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(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_8__repr__(struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_7Message_12__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 int __pyx_pf_7pyarrow_3lib_18_RecordBatchWriter___cinit__(struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__pyx_v_self); /* proto */
static void __pyx_pf_7pyarrow_3lib_18_RecordBatchWriter_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchWriter_4_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__pyx_v_self, PyObject *__pyx_v_sink, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchWriter_6write(struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__pyx_v_self, PyObject *__pyx_v_table_or_batch); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchWriter_8write_batch(struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchWriter_10write_table(struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table, PyObject *__pyx_v_chunksize); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchWriter_12close(struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchWriter_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchWriter_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_7pyarrow_3lib_18_RecordBatchReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchReader_2_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchReader_4__iter__(struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchReader_7get_next_batch(struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchReader_9read_next_batch(struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchReader_11read_all(struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchReader_6schema___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchReader_13__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchReader_15__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__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); /* 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_6schema___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchFileReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_22_RecordBatchFileReader_10__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_126get_tensor_size(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_Tensor *__pyx_v_tensor); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_128get_record_batch_size(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_batch); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_130write_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_132read_tensor(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_134read_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_136read_schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_138read_record_batch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema); /* 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__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_FeatherReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_13FeatherReader_10__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_140is_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_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_142serialize(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_144serialize_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_146read_serialized(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source, PyObject *__pyx_v_base); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_148deserialize_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_150deserialize_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_152deserialize(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_154benchmark_PandasObjectIsNull(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7pyarrow_3lib_163__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_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_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_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_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_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_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_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_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_ChunkedArray(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib_Column(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_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_StructType(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_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_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_BinaryValue(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__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_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__RecordBatchWriter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchReader(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___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_4___iter__(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_iterchunks(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_7_itercolumns(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_8_download(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_9_upload(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___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_13_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items = {0, &__pyx_n_s_items, 0, 0, 0};
static PyObject *__pyx_float_1e3;
static PyObject *__pyx_float_1e6;
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_86400;
static PyObject *__pyx_int_1000000;
static PyObject *__pyx_int_162458991;
static PyObject *__pyx_int_1000000000;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
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__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
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__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_tuple__100;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__102;
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__118;
static PyObject *__pyx_tuple__120;
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__169;
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__181;
static PyObject *__pyx_tuple__182;
static PyObject *__pyx_tuple__183;
static PyObject *__pyx_tuple__185;
static PyObject *__pyx_tuple__187;
static PyObject *__pyx_tuple__189;
static PyObject *__pyx_tuple__191;
static PyObject *__pyx_tuple__193;
static PyObject *__pyx_tuple__195;
static PyObject *__pyx_tuple__197;
static PyObject *__pyx_tuple__198;
static PyObject *__pyx_tuple__200;
static PyObject *__pyx_tuple__212;
static PyObject *__pyx_tuple__213;
static PyObject *__pyx_tuple__215;
static PyObject *__pyx_tuple__217;
static PyObject *__pyx_tuple__219;
static PyObject *__pyx_tuple__221;
static PyObject *__pyx_tuple__229;
static PyObject *__pyx_tuple__231;
static PyObject *__pyx_tuple__233;
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__241;
static PyObject *__pyx_tuple__243;
static PyObject *__pyx_tuple__245;
static PyObject *__pyx_tuple__247;
static PyObject *__pyx_tuple__249;
static PyObject *__pyx_tuple__251;
static PyObject *__pyx_tuple__253;
static PyObject *__pyx_tuple__255;
static PyObject *__pyx_tuple__257;
static PyObject *__pyx_tuple__259;
static PyObject *__pyx_tuple__261;
static PyObject *__pyx_tuple__263;
static PyObject *__pyx_tuple__265;
static PyObject *__pyx_tuple__267;
static PyObject *__pyx_tuple__269;
static PyObject *__pyx_tuple__271;
static PyObject *__pyx_tuple__273;
static PyObject *__pyx_tuple__275;
static PyObject *__pyx_tuple__277;
static PyObject *__pyx_tuple__279;
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__303;
static PyObject *__pyx_tuple__305;
static PyObject *__pyx_tuple__307;
static PyObject *__pyx_tuple__309;
static PyObject *__pyx_tuple__311;
static PyObject *__pyx_tuple__313;
static PyObject *__pyx_tuple__315;
static PyObject *__pyx_tuple__318;
static PyObject *__pyx_tuple__320;
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__334;
static PyObject *__pyx_tuple__336;
static PyObject *__pyx_tuple__338;
static PyObject *__pyx_tuple__340;
static PyObject *__pyx_tuple__342;
static PyObject *__pyx_tuple__344;
static PyObject *__pyx_tuple__346;
static PyObject *__pyx_tuple__348;
static PyObject *__pyx_tuple__350;
static PyObject *__pyx_tuple__352;
static PyObject *__pyx_tuple__354;
static PyObject *__pyx_tuple__356;
static PyObject *__pyx_tuple__358;
static PyObject *__pyx_codeobj__116;
static PyObject *__pyx_codeobj__117;
static PyObject *__pyx_codeobj__119;
static PyObject *__pyx_codeobj__121;
static PyObject *__pyx_codeobj__184;
static PyObject *__pyx_codeobj__186;
static PyObject *__pyx_codeobj__188;
static PyObject *__pyx_codeobj__190;
static PyObject *__pyx_codeobj__192;
static PyObject *__pyx_codeobj__194;
static PyObject *__pyx_codeobj__196;
static PyObject *__pyx_codeobj__199;
static PyObject *__pyx_codeobj__201;
static PyObject *__pyx_codeobj__202;
static PyObject *__pyx_codeobj__203;
static PyObject *__pyx_codeobj__204;
static PyObject *__pyx_codeobj__205;
static PyObject *__pyx_codeobj__206;
static PyObject *__pyx_codeobj__207;
static PyObject *__pyx_codeobj__208;
static PyObject *__pyx_codeobj__209;
static PyObject *__pyx_codeobj__210;
static PyObject *__pyx_codeobj__211;
static PyObject *__pyx_codeobj__214;
static PyObject *__pyx_codeobj__216;
static PyObject *__pyx_codeobj__218;
static PyObject *__pyx_codeobj__220;
static PyObject *__pyx_codeobj__222;
static PyObject *__pyx_codeobj__223;
static PyObject *__pyx_codeobj__224;
static PyObject *__pyx_codeobj__225;
static PyObject *__pyx_codeobj__226;
static PyObject *__pyx_codeobj__227;
static PyObject *__pyx_codeobj__228;
static PyObject *__pyx_codeobj__230;
static PyObject *__pyx_codeobj__232;
static PyObject *__pyx_codeobj__234;
static PyObject *__pyx_codeobj__240;
static PyObject *__pyx_codeobj__242;
static PyObject *__pyx_codeobj__244;
static PyObject *__pyx_codeobj__246;
static PyObject *__pyx_codeobj__248;
static PyObject *__pyx_codeobj__250;
static PyObject *__pyx_codeobj__252;
static PyObject *__pyx_codeobj__254;
static PyObject *__pyx_codeobj__256;
static PyObject *__pyx_codeobj__258;
static PyObject *__pyx_codeobj__260;
static PyObject *__pyx_codeobj__262;
static PyObject *__pyx_codeobj__264;
static PyObject *__pyx_codeobj__266;
static PyObject *__pyx_codeobj__268;
static PyObject *__pyx_codeobj__270;
static PyObject *__pyx_codeobj__272;
static PyObject *__pyx_codeobj__274;
static PyObject *__pyx_codeobj__276;
static PyObject *__pyx_codeobj__278;
static PyObject *__pyx_codeobj__280;
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__302;
static PyObject *__pyx_codeobj__304;
static PyObject *__pyx_codeobj__306;
static PyObject *__pyx_codeobj__308;
static PyObject *__pyx_codeobj__310;
static PyObject *__pyx_codeobj__312;
static PyObject *__pyx_codeobj__314;
static PyObject *__pyx_codeobj__316;
static PyObject *__pyx_codeobj__317;
static PyObject *__pyx_codeobj__319;
static PyObject *__pyx_codeobj__321;
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__335;
static PyObject *__pyx_codeobj__337;
static PyObject *__pyx_codeobj__339;
static PyObject *__pyx_codeobj__341;
static PyObject *__pyx_codeobj__343;
static PyObject *__pyx_codeobj__345;
static PyObject *__pyx_codeobj__347;
static PyObject *__pyx_codeobj__349;
static PyObject *__pyx_codeobj__351;
static PyObject *__pyx_codeobj__353;
static PyObject *__pyx_codeobj__355;
static PyObject *__pyx_codeobj__357;
static PyObject *__pyx_codeobj__359;
/* Late includes */

/* "pyarrow/scalar.pxi":202
 * except ImportError:
 *     DATETIME_CONVERSION_FUNCTIONS = {
 *         TimeUnit_SECOND: lambda x, tzinfo: (             # <<<<<<<<<<<<<<
 *             datetime.datetime.utcfromtimestamp(x).replace(tzinfo=tzinfo)
 *         ),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_156lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_156lambda = {"lambda", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_156lambda, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_156lambda(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(1, 202, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda") < 0)) __PYX_ERR(1, 202, __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(1, 202, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_7pyarrow_3lib_lambda(__pyx_self, __pyx_v_x, __pyx_v_tzinfo);

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

static PyObject *__pyx_lambda_funcdef_7pyarrow_3lib_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("lambda", 0);

  /* "pyarrow/scalar.pxi":203
 *     DATETIME_CONVERSION_FUNCTIONS = {
 *         TimeUnit_SECOND: lambda x, tzinfo: (
 *             datetime.datetime.utcfromtimestamp(x).replace(tzinfo=tzinfo)             # <<<<<<<<<<<<<<
 *         ),
 *         TimeUnit_MILLI: lambda x, tzinfo: (
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 203, __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(1, 203, __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_utcfromtimestamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 203, __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_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_x) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_x);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 203, __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_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 203, __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(1, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tzinfo, __pyx_v_tzinfo) < 0) __PYX_ERR(1, 203, __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(1, 203, __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/scalar.pxi":202
 * except ImportError:
 *     DATETIME_CONVERSION_FUNCTIONS = {
 *         TimeUnit_SECOND: lambda x, tzinfo: (             # <<<<<<<<<<<<<<
 *             datetime.datetime.utcfromtimestamp(x).replace(tzinfo=tzinfo)
 *         ),
 */

  /* 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.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":205
 *             datetime.datetime.utcfromtimestamp(x).replace(tzinfo=tzinfo)
 *         ),
 *         TimeUnit_MILLI: lambda x, tzinfo: (             # <<<<<<<<<<<<<<
 *             datetime.datetime.utcfromtimestamp(x / 1e3).replace(tzinfo=tzinfo)
 *         ),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_157lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_157lambda1 = {"lambda1", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_157lambda1, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_157lambda1(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("lambda1 (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("lambda1", 1, 2, 2, 1); __PYX_ERR(1, 205, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda1") < 0)) __PYX_ERR(1, 205, __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("lambda1", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 205, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_7pyarrow_3lib_lambda1(__pyx_self, __pyx_v_x, __pyx_v_tzinfo);

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

static PyObject *__pyx_lambda_funcdef_7pyarrow_3lib_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo) {
  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("lambda1", 0);

  /* "pyarrow/scalar.pxi":206
 *         ),
 *         TimeUnit_MILLI: lambda x, tzinfo: (
 *             datetime.datetime.utcfromtimestamp(x / 1e3).replace(tzinfo=tzinfo)             # <<<<<<<<<<<<<<
 *         ),
 *         TimeUnit_MICRO: lambda x, tzinfo: (
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 206, __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(1, 206, __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_utcfromtimestamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyFloat_DivideObjC(__pyx_v_x, __pyx_float_1e3, 1e3, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 206, __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(1, 206, __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_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 206, __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(1, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tzinfo, __pyx_v_tzinfo) < 0) __PYX_ERR(1, 206, __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(1, 206, __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/scalar.pxi":205
 *             datetime.datetime.utcfromtimestamp(x).replace(tzinfo=tzinfo)
 *         ),
 *         TimeUnit_MILLI: lambda x, tzinfo: (             # <<<<<<<<<<<<<<
 *             datetime.datetime.utcfromtimestamp(x / 1e3).replace(tzinfo=tzinfo)
 *         ),
 */

  /* 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.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":208
 *             datetime.datetime.utcfromtimestamp(x / 1e3).replace(tzinfo=tzinfo)
 *         ),
 *         TimeUnit_MICRO: lambda x, tzinfo: (             # <<<<<<<<<<<<<<
 *             datetime.datetime.utcfromtimestamp(x / 1e6).replace(tzinfo=tzinfo)
 *         ),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_158lambda2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_158lambda2 = {"lambda2", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_158lambda2, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_158lambda2(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("lambda2 (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("lambda2", 1, 2, 2, 1); __PYX_ERR(1, 208, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda2") < 0)) __PYX_ERR(1, 208, __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("lambda2", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 208, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_7pyarrow_3lib_lambda2(__pyx_self, __pyx_v_x, __pyx_v_tzinfo);

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

static PyObject *__pyx_lambda_funcdef_7pyarrow_3lib_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo) {
  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("lambda2", 0);

  /* "pyarrow/scalar.pxi":209
 *         ),
 *         TimeUnit_MICRO: lambda x, tzinfo: (
 *             datetime.datetime.utcfromtimestamp(x / 1e6).replace(tzinfo=tzinfo)             # <<<<<<<<<<<<<<
 *         ),
 *     }
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 209, __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(1, 209, __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_utcfromtimestamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyFloat_DivideObjC(__pyx_v_x, __pyx_float_1e6, 1e6, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 209, __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(1, 209, __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_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 209, __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(1, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tzinfo, __pyx_v_tzinfo) < 0) __PYX_ERR(1, 209, __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(1, 209, __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/scalar.pxi":208
 *             datetime.datetime.utcfromtimestamp(x / 1e3).replace(tzinfo=tzinfo)
 *         ),
 *         TimeUnit_MICRO: lambda x, tzinfo: (             # <<<<<<<<<<<<<<
 *             datetime.datetime.utcfromtimestamp(x / 1e6).replace(tzinfo=tzinfo)
 *         ),
 */

  /* 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.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":214
 * else:
 *     DATETIME_CONVERSION_FUNCTIONS = {
 *         TimeUnit_SECOND: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *             x * 1000000000, tz=tzinfo, unit='ns',
 *         ),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_159lambda3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_159lambda3 = {"lambda3", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_159lambda3, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_159lambda3(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("lambda3 (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("lambda3", 1, 2, 2, 1); __PYX_ERR(1, 214, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda3") < 0)) __PYX_ERR(1, 214, __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("lambda3", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 214, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_7pyarrow_3lib_lambda3(__pyx_self, __pyx_v_x, __pyx_v_tzinfo);

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

static PyObject *__pyx_lambda_funcdef_7pyarrow_3lib_lambda3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo) {
  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("lambda3", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pd); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":215
 *     DATETIME_CONVERSION_FUNCTIONS = {
 *         TimeUnit_SECOND: lambda x, tzinfo: pd.Timestamp(
 *             x * 1000000000, tz=tzinfo, unit='ns',             # <<<<<<<<<<<<<<
 *         ),
 *         TimeUnit_MILLI: lambda x, tzinfo: pd.Timestamp(
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_x, __pyx_int_1000000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/scalar.pxi":214
 * else:
 *     DATETIME_CONVERSION_FUNCTIONS = {
 *         TimeUnit_SECOND: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *             x * 1000000000, tz=tzinfo, unit='ns',
 *         ),
 */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":215
 *     DATETIME_CONVERSION_FUNCTIONS = {
 *         TimeUnit_SECOND: lambda x, tzinfo: pd.Timestamp(
 *             x * 1000000000, tz=tzinfo, unit='ns',             # <<<<<<<<<<<<<<
 *         ),
 *         TimeUnit_MILLI: lambda x, tzinfo: pd.Timestamp(
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tz, __pyx_v_tzinfo) < 0) __PYX_ERR(1, 215, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_unit, __pyx_n_s_ns) < 0) __PYX_ERR(1, 215, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":214
 * else:
 *     DATETIME_CONVERSION_FUNCTIONS = {
 *         TimeUnit_SECOND: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *             x * 1000000000, tz=tzinfo, unit='ns',
 *         ),
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":217
 *             x * 1000000000, tz=tzinfo, unit='ns',
 *         ),
 *         TimeUnit_MILLI: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *             x * 1000000, tz=tzinfo, unit='ns',
 *         ),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_160lambda4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_160lambda4 = {"lambda4", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_160lambda4, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_160lambda4(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("lambda4 (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("lambda4", 1, 2, 2, 1); __PYX_ERR(1, 217, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda4") < 0)) __PYX_ERR(1, 217, __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("lambda4", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 217, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_7pyarrow_3lib_lambda4(__pyx_self, __pyx_v_x, __pyx_v_tzinfo);

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

static PyObject *__pyx_lambda_funcdef_7pyarrow_3lib_lambda4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo) {
  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_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pd); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":218
 *         ),
 *         TimeUnit_MILLI: lambda x, tzinfo: pd.Timestamp(
 *             x * 1000000, tz=tzinfo, unit='ns',             # <<<<<<<<<<<<<<
 *         ),
 *         TimeUnit_MICRO: lambda x, tzinfo: pd.Timestamp(
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_x, __pyx_int_1000000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/scalar.pxi":217
 *             x * 1000000000, tz=tzinfo, unit='ns',
 *         ),
 *         TimeUnit_MILLI: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *             x * 1000000, tz=tzinfo, unit='ns',
 *         ),
 */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":218
 *         ),
 *         TimeUnit_MILLI: lambda x, tzinfo: pd.Timestamp(
 *             x * 1000000, tz=tzinfo, unit='ns',             # <<<<<<<<<<<<<<
 *         ),
 *         TimeUnit_MICRO: lambda x, tzinfo: pd.Timestamp(
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tz, __pyx_v_tzinfo) < 0) __PYX_ERR(1, 218, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_unit, __pyx_n_s_ns) < 0) __PYX_ERR(1, 218, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":217
 *             x * 1000000000, tz=tzinfo, unit='ns',
 *         ),
 *         TimeUnit_MILLI: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *             x * 1000000, tz=tzinfo, unit='ns',
 *         ),
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":220
 *             x * 1000000, tz=tzinfo, unit='ns',
 *         ),
 *         TimeUnit_MICRO: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *             x * 1000, tz=tzinfo, unit='ns',
 *         ),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_161lambda5(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_161lambda5 = {"lambda5", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_161lambda5, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_161lambda5(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("lambda5 (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("lambda5", 1, 2, 2, 1); __PYX_ERR(1, 220, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda5") < 0)) __PYX_ERR(1, 220, __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("lambda5", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 220, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_7pyarrow_3lib_lambda5(__pyx_self, __pyx_v_x, __pyx_v_tzinfo);

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

static PyObject *__pyx_lambda_funcdef_7pyarrow_3lib_lambda5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo) {
  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("lambda5", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pd); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":221
 *         ),
 *         TimeUnit_MICRO: lambda x, tzinfo: pd.Timestamp(
 *             x * 1000, tz=tzinfo, unit='ns',             # <<<<<<<<<<<<<<
 *         ),
 *         TimeUnit_NANO: lambda x, tzinfo: pd.Timestamp(
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_x, __pyx_int_1000); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/scalar.pxi":220
 *             x * 1000000, tz=tzinfo, unit='ns',
 *         ),
 *         TimeUnit_MICRO: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *             x * 1000, tz=tzinfo, unit='ns',
 *         ),
 */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":221
 *         ),
 *         TimeUnit_MICRO: lambda x, tzinfo: pd.Timestamp(
 *             x * 1000, tz=tzinfo, unit='ns',             # <<<<<<<<<<<<<<
 *         ),
 *         TimeUnit_NANO: lambda x, tzinfo: pd.Timestamp(
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tz, __pyx_v_tzinfo) < 0) __PYX_ERR(1, 221, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_unit, __pyx_n_s_ns) < 0) __PYX_ERR(1, 221, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":220
 *             x * 1000000, tz=tzinfo, unit='ns',
 *         ),
 *         TimeUnit_MICRO: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *             x * 1000, tz=tzinfo, unit='ns',
 *         ),
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/scalar.pxi":223
 *             x * 1000, tz=tzinfo, unit='ns',
 *         ),
 *         TimeUnit_NANO: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *             x, tz=tzinfo, unit='ns',
 *         )
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_162lambda6(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7pyarrow_3lib_162lambda6 = {"lambda6", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_162lambda6, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7pyarrow_3lib_162lambda6(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("lambda6 (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("lambda6", 1, 2, 2, 1); __PYX_ERR(1, 223, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda6") < 0)) __PYX_ERR(1, 223, __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("lambda6", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 223, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_lambda_funcdef_7pyarrow_3lib_lambda6(__pyx_self, __pyx_v_x, __pyx_v_tzinfo);

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

static PyObject *__pyx_lambda_funcdef_7pyarrow_3lib_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_tzinfo) {
  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("lambda6", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pd); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Timestamp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":224
 *         ),
 *         TimeUnit_NANO: lambda x, tzinfo: pd.Timestamp(
 *             x, tz=tzinfo, unit='ns',             # <<<<<<<<<<<<<<
 *         )
 *     }
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_x);
  __Pyx_GIVEREF(__pyx_v_x);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
  __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_tz, __pyx_v_tzinfo) < 0) __PYX_ERR(1, 224, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_unit, __pyx_n_s_ns) < 0) __PYX_ERR(1, 224, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":223
 *             x * 1000, tz=tzinfo, unit='ns',
 *         ),
 *         TimeUnit_NANO: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *             x, tz=tzinfo, unit='ns',
 *         )
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 223, __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_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.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/lib.pyx":40
 * 
 * 
 * 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.  If neither\n    is present, it will default to the number of hardware threads on the\n    system.  It can be modified at runtime by calling 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":49
 *     system.  It can be modified at runtime by calling 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(6, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/lib.pyx":40
 * 
 * 
 * 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":52
 * 
 * 
 * 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(6, 52, __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":56
 *     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":57
 *     """
 *     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(6, 57, __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, 57, __pyx_L1_error)

    /* "pyarrow/lib.pyx":56
 *     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":58
 *     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(6, 58, __pyx_L1_error)

  /* "pyarrow/lib.pyx":52
 * 
 * 
 * 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/error.pxi":71
 * 
 * 
 * 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;
  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":72
 * 
 * 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":73
 * cdef int check_status(const CStatus& status) nogil except -1:
 *     if status.ok():
 *         return 0             # <<<<<<<<<<<<<<
 * 
 *     if status.IsPythonError():
 */
      __pyx_r = 0;
      goto __pyx_L3_return;

      /* "pyarrow/error.pxi":72
 * 
 * cdef int check_status(const CStatus& status) nogil except -1:
 *     if status.ok():             # <<<<<<<<<<<<<<
 *         return 0
 * 
 */
    }

    /* "pyarrow/error.pxi":75
 *         return 0
 * 
 *     if status.IsPythonError():             # <<<<<<<<<<<<<<
 *         return -1
 * 
 */
    __pyx_t_1 = (__pyx_v_status.IsPythonError() != 0);
    if (__pyx_t_1) {

      /* "pyarrow/error.pxi":76
 * 
 *     if status.IsPythonError():
 *         return -1             # <<<<<<<<<<<<<<
 * 
 *     with gil:
 */
      __pyx_r = -1;
      goto __pyx_L3_return;

      /* "pyarrow/error.pxi":75
 *         return 0
 * 
 *     if status.IsPythonError():             # <<<<<<<<<<<<<<
 *         return -1
 * 
 */
    }

    /* "pyarrow/error.pxi":78
 *         return -1
 * 
 *     with gil:             # <<<<<<<<<<<<<<
 *         message = frombytes(status.message())
 *         if status.IsInvalid():
 */
    {
        #ifdef WITH_THREAD
        PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
        #endif
        /*try:*/ {

          /* "pyarrow/error.pxi":79
 * 
 *     with gil:
 *         message = frombytes(status.message())             # <<<<<<<<<<<<<<
 *         if status.IsInvalid():
 *             raise ArrowInvalid(message)
 */
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L9_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, 79, __pyx_L9_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, 79, __pyx_L9_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":80
 *     with gil:
 *         message = frombytes(status.message())
 *         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":81
 *         message = frombytes(status.message())
 *         if status.IsInvalid():
 *             raise ArrowInvalid(message)             # <<<<<<<<<<<<<<
 *         elif status.IsIOError():
 *             raise ArrowIOError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowInvalid); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 81, __pyx_L9_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, 81, __pyx_L9_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, 81, __pyx_L9_error)

            /* "pyarrow/error.pxi":80
 *     with gil:
 *         message = frombytes(status.message())
 *         if status.IsInvalid():             # <<<<<<<<<<<<<<
 *             raise ArrowInvalid(message)
 *         elif status.IsIOError():
 */
          }

          /* "pyarrow/error.pxi":82
 *         if status.IsInvalid():
 *             raise ArrowInvalid(message)
 *         elif status.IsIOError():             # <<<<<<<<<<<<<<
 *             raise ArrowIOError(message)
 *         elif status.IsOutOfMemory():
 */
          __pyx_t_1 = (__pyx_v_status.IsIOError() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":83
 *             raise ArrowInvalid(message)
 *         elif status.IsIOError():
 *             raise ArrowIOError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsOutOfMemory():
 *             raise ArrowMemoryError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowIOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L9_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, 83, __pyx_L9_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, 83, __pyx_L9_error)

            /* "pyarrow/error.pxi":82
 *         if status.IsInvalid():
 *             raise ArrowInvalid(message)
 *         elif status.IsIOError():             # <<<<<<<<<<<<<<
 *             raise ArrowIOError(message)
 *         elif status.IsOutOfMemory():
 */
          }

          /* "pyarrow/error.pxi":84
 *         elif status.IsIOError():
 *             raise ArrowIOError(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":85
 *             raise ArrowIOError(message)
 *         elif status.IsOutOfMemory():
 *             raise ArrowMemoryError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsKeyError():
 *             raise ArrowKeyError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowMemoryError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L9_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, 85, __pyx_L9_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, 85, __pyx_L9_error)

            /* "pyarrow/error.pxi":84
 *         elif status.IsIOError():
 *             raise ArrowIOError(message)
 *         elif status.IsOutOfMemory():             # <<<<<<<<<<<<<<
 *             raise ArrowMemoryError(message)
 *         elif status.IsKeyError():
 */
          }

          /* "pyarrow/error.pxi":86
 *         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":87
 *             raise ArrowMemoryError(message)
 *         elif status.IsKeyError():
 *             raise ArrowKeyError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsNotImplemented():
 *             raise ArrowNotImplementedError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowKeyError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L9_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, 87, __pyx_L9_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, 87, __pyx_L9_error)

            /* "pyarrow/error.pxi":86
 *         elif status.IsOutOfMemory():
 *             raise ArrowMemoryError(message)
 *         elif status.IsKeyError():             # <<<<<<<<<<<<<<
 *             raise ArrowKeyError(message)
 *         elif status.IsNotImplemented():
 */
          }

          /* "pyarrow/error.pxi":88
 *         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":89
 *             raise ArrowKeyError(message)
 *         elif status.IsNotImplemented():
 *             raise ArrowNotImplementedError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsTypeError():
 *             raise ArrowTypeError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowNotImplementedError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L9_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, 89, __pyx_L9_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, 89, __pyx_L9_error)

            /* "pyarrow/error.pxi":88
 *         elif status.IsKeyError():
 *             raise ArrowKeyError(message)
 *         elif status.IsNotImplemented():             # <<<<<<<<<<<<<<
 *             raise ArrowNotImplementedError(message)
 *         elif status.IsTypeError():
 */
          }

          /* "pyarrow/error.pxi":90
 *         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":91
 *             raise ArrowNotImplementedError(message)
 *         elif status.IsTypeError():
 *             raise ArrowTypeError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsCapacityError():
 *             raise ArrowCapacityError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowTypeError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L9_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, 91, __pyx_L9_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, 91, __pyx_L9_error)

            /* "pyarrow/error.pxi":90
 *         elif status.IsNotImplemented():
 *             raise ArrowNotImplementedError(message)
 *         elif status.IsTypeError():             # <<<<<<<<<<<<<<
 *             raise ArrowTypeError(message)
 *         elif status.IsCapacityError():
 */
          }

          /* "pyarrow/error.pxi":92
 *         elif status.IsTypeError():
 *             raise ArrowTypeError(message)
 *         elif status.IsCapacityError():             # <<<<<<<<<<<<<<
 *             raise ArrowCapacityError(message)
 *         elif status.IsPlasmaObjectExists():
 */
          __pyx_t_1 = (__pyx_v_status.IsCapacityError() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":93
 *             raise ArrowTypeError(message)
 *         elif status.IsCapacityError():
 *             raise ArrowCapacityError(message)             # <<<<<<<<<<<<<<
 *         elif status.IsPlasmaObjectExists():
 *             raise PlasmaObjectExists(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowCapacityError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L9_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, 93, __pyx_L9_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, 93, __pyx_L9_error)

            /* "pyarrow/error.pxi":92
 *         elif status.IsTypeError():
 *             raise ArrowTypeError(message)
 *         elif status.IsCapacityError():             # <<<<<<<<<<<<<<
 *             raise ArrowCapacityError(message)
 *         elif status.IsPlasmaObjectExists():
 */
          }

          /* "pyarrow/error.pxi":94
 *         elif status.IsCapacityError():
 *             raise ArrowCapacityError(message)
 *         elif status.IsPlasmaObjectExists():             # <<<<<<<<<<<<<<
 *             raise PlasmaObjectExists(message)
 *         elif status.IsPlasmaObjectNonexistent():
 */
          __pyx_t_1 = (__pyx_v_status.IsPlasmaObjectExists() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":95
 *             raise ArrowCapacityError(message)
 *         elif status.IsPlasmaObjectExists():
 *             raise PlasmaObjectExists(message)             # <<<<<<<<<<<<<<
 *         elif status.IsPlasmaObjectNonexistent():
 *             raise PlasmaObjectNonexistent(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PlasmaObjectExists); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L9_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, 95, __pyx_L9_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, 95, __pyx_L9_error)

            /* "pyarrow/error.pxi":94
 *         elif status.IsCapacityError():
 *             raise ArrowCapacityError(message)
 *         elif status.IsPlasmaObjectExists():             # <<<<<<<<<<<<<<
 *             raise PlasmaObjectExists(message)
 *         elif status.IsPlasmaObjectNonexistent():
 */
          }

          /* "pyarrow/error.pxi":96
 *         elif status.IsPlasmaObjectExists():
 *             raise PlasmaObjectExists(message)
 *         elif status.IsPlasmaObjectNonexistent():             # <<<<<<<<<<<<<<
 *             raise PlasmaObjectNonexistent(message)
 *         elif status.IsPlasmaStoreFull():
 */
          __pyx_t_1 = (__pyx_v_status.IsPlasmaObjectNonexistent() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":97
 *             raise PlasmaObjectExists(message)
 *         elif status.IsPlasmaObjectNonexistent():
 *             raise PlasmaObjectNonexistent(message)             # <<<<<<<<<<<<<<
 *         elif status.IsPlasmaStoreFull():
 *             raise PlasmaStoreFull(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PlasmaObjectNonexistent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L9_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, 97, __pyx_L9_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, 97, __pyx_L9_error)

            /* "pyarrow/error.pxi":96
 *         elif status.IsPlasmaObjectExists():
 *             raise PlasmaObjectExists(message)
 *         elif status.IsPlasmaObjectNonexistent():             # <<<<<<<<<<<<<<
 *             raise PlasmaObjectNonexistent(message)
 *         elif status.IsPlasmaStoreFull():
 */
          }

          /* "pyarrow/error.pxi":98
 *         elif status.IsPlasmaObjectNonexistent():
 *             raise PlasmaObjectNonexistent(message)
 *         elif status.IsPlasmaStoreFull():             # <<<<<<<<<<<<<<
 *             raise PlasmaStoreFull(message)
 *         elif status.IsSerializationError():
 */
          __pyx_t_1 = (__pyx_v_status.IsPlasmaStoreFull() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":99
 *             raise PlasmaObjectNonexistent(message)
 *         elif status.IsPlasmaStoreFull():
 *             raise PlasmaStoreFull(message)             # <<<<<<<<<<<<<<
 *         elif status.IsSerializationError():
 *             raise ArrowSerializationError(message)
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_PlasmaStoreFull); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 99, __pyx_L9_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, 99, __pyx_L9_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, 99, __pyx_L9_error)

            /* "pyarrow/error.pxi":98
 *         elif status.IsPlasmaObjectNonexistent():
 *             raise PlasmaObjectNonexistent(message)
 *         elif status.IsPlasmaStoreFull():             # <<<<<<<<<<<<<<
 *             raise PlasmaStoreFull(message)
 *         elif status.IsSerializationError():
 */
          }

          /* "pyarrow/error.pxi":100
 *         elif status.IsPlasmaStoreFull():
 *             raise PlasmaStoreFull(message)
 *         elif status.IsSerializationError():             # <<<<<<<<<<<<<<
 *             raise ArrowSerializationError(message)
 *         else:
 */
          __pyx_t_1 = (__pyx_v_status.IsSerializationError() != 0);
          if (unlikely(__pyx_t_1)) {

            /* "pyarrow/error.pxi":101
 *             raise PlasmaStoreFull(message)
 *         elif status.IsSerializationError():
 *             raise ArrowSerializationError(message)             # <<<<<<<<<<<<<<
 *         else:
 *             message = frombytes(status.ToString())
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowSerializationError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L9_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, 101, __pyx_L9_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, 101, __pyx_L9_error)

            /* "pyarrow/error.pxi":100
 *         elif status.IsPlasmaStoreFull():
 *             raise PlasmaStoreFull(message)
 *         elif status.IsSerializationError():             # <<<<<<<<<<<<<<
 *             raise ArrowSerializationError(message)
 *         else:
 */
          }

          /* "pyarrow/error.pxi":103
 *             raise ArrowSerializationError(message)
 *         else:
 *             message = frombytes(status.ToString())             # <<<<<<<<<<<<<<
 *             raise ArrowException(message)
 */
          /*else*/ {
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_status.ToString()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 103, __pyx_L9_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, 103, __pyx_L9_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":104
 *         else:
 *             message = frombytes(status.ToString())
 *             raise ArrowException(message)             # <<<<<<<<<<<<<<
 */
            __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L9_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, 104, __pyx_L9_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, 104, __pyx_L9_error)
          }
        }

        /* "pyarrow/error.pxi":78
 *         return -1
 * 
 *     with gil:             # <<<<<<<<<<<<<<
 *         message = frombytes(status.message())
 *         if status.IsInvalid():
 */
        /*finally:*/ {
          __pyx_L9_error: {
            #ifdef WITH_THREAD
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            #endif
            goto __pyx_L4_error;
          }
        }
    }
  }

  /* "pyarrow/error.pxi":72
 * 
 * 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":71
 * 
 * 
 * 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/memory.pxi":25
 * cdef class MemoryPool:
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly"
 *                         .format(self.__class__.__name__))
 */

/* 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":27
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly"
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, CMemoryPool* pool):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Do_not_call_s_constructor_direct, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 27, __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(7, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 27, __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(7, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":26
 * 
 *     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(7, 26, __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, 26, __pyx_L1_error)

  /* "pyarrow/memory.pxi":25
 * cdef class MemoryPool:
 * 
 *     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.MemoryPool.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":29
 *                         .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":30
 * 
 *     cdef void init(self, CMemoryPool* pool):
 *         self.pool = pool             # <<<<<<<<<<<<<<
 * 
 *     def bytes_allocated(self):
 */
  __pyx_v_self->pool = __pyx_v_pool;

  /* "pyarrow/memory.pxi":29
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, CMemoryPool* pool):             # <<<<<<<<<<<<<<
 *         self.pool = pool
 * 
 */

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

/* "pyarrow/memory.pxi":32
 *         self.pool = pool
 * 
 *     def bytes_allocated(self):             # <<<<<<<<<<<<<<
 *         return self.pool.bytes_allocated()
 * 
 */

/* 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)";
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":33
 * 
 *     def bytes_allocated(self):
 *         return self.pool.bytes_allocated()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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(7, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":32
 *         self.pool = pool
 * 
 *     def bytes_allocated(self):             # <<<<<<<<<<<<<<
 *         return self.pool.bytes_allocated()
 * 
 */

  /* 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;
}

/* "(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_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10MemoryPool_4__reduce_cython__[] = "MemoryPool.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_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_10MemoryPool_4__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_4__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__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10MemoryPool_6__setstate_cython__[] = "MemoryPool.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10MemoryPool_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_10MemoryPool_6__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_6__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__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":36
 * 
 * 
 * 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":37
 * 
 * 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":38
 * 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":37
 * 
 * cdef CMemoryPool* maybe_unbox_memory_pool(MemoryPool memory_pool):
 *     if memory_pool is None:             # <<<<<<<<<<<<<<
 *         return c_get_memory_pool()
 *     else:
 */
  }

  /* "pyarrow/memory.pxi":40
 *         return c_get_memory_pool()
 *     else:
 *         return memory_pool.pool             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_r = __pyx_v_memory_pool->pool;
    goto __pyx_L0;
  }

  /* "pyarrow/memory.pxi":36
 * 
 * 
 * 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":47
 *         unique_ptr[CLoggingMemoryPool] logging_pool
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call {}'s constructor directly"
 *                         .format(self.__class__.__name__))
 */

/* 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":49
 *     def __init__(self):
 *         raise TypeError("Do not call {}'s constructor directly"
 *                         .format(self.__class__.__name__))             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, MemoryPool pool):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Do_not_call_s_constructor_direct, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 49, __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(7, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 49, __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(7, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":48
 * 
 *     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(7, 48, __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, 48, __pyx_L1_error)

  /* "pyarrow/memory.pxi":47
 *         unique_ptr[CLoggingMemoryPool] logging_pool
 * 
 *     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.LoggingMemoryPool.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":51
 *                         .format(self.__class__.__name__))
 * 
 *     def __cinit__(self, MemoryPool pool):             # <<<<<<<<<<<<<<
 *         self.logging_pool.reset(new CLoggingMemoryPool(pool.pool))
 *         self.init(self.logging_pool.get())
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pool,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_pool)) != 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, 51, __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_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)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, 51, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.LoggingMemoryPool.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "pool", 0))) __PYX_ERR(7, 51, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_17LoggingMemoryPool_2__cinit__(((struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *)__pyx_v_self), __pyx_v_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_17LoggingMemoryPool_2__cinit__(struct __pyx_obj_7pyarrow_3lib_LoggingMemoryPool *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_pool) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/memory.pxi":52
 * 
 *     def __cinit__(self, MemoryPool pool):
 *         self.logging_pool.reset(new CLoggingMemoryPool(pool.pool))             # <<<<<<<<<<<<<<
 *         self.init(self.logging_pool.get())
 * 
 */
  __pyx_v_self->logging_pool.reset(new  arrow::LoggingMemoryPool(__pyx_v_pool->pool));

  /* "pyarrow/memory.pxi":53
 *     def __cinit__(self, MemoryPool pool):
 *         self.logging_pool.reset(new CLoggingMemoryPool(pool.pool))
 *         self.init(self.logging_pool.get())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_LoggingMemoryPool *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)__pyx_v_self), __pyx_v_self->logging_pool.get());

  /* "pyarrow/memory.pxi":51
 *                         .format(self.__class__.__name__))
 * 
 *     def __cinit__(self, MemoryPool pool):             # <<<<<<<<<<<<<<
 *         self.logging_pool.reset(new CLoggingMemoryPool(pool.pool))
 *         self.init(self.logging_pool.get())
 */

  /* 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_17LoggingMemoryPool_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_17LoggingMemoryPool_4__reduce_cython__[] = "LoggingMemoryPool.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_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_17LoggingMemoryPool_4__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_4__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("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__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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.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("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_17LoggingMemoryPool_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_17LoggingMemoryPool_6__setstate_cython__[] = "LoggingMemoryPool.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_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_17LoggingMemoryPool_6__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_6__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("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__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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.LoggingMemoryPool.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/memory.pxi":64
 *         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":67
 *         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_s_Do_not_call_s_constructor_direct_2, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 67, __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(7, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 67, __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(7, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":65
 * 
 *     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(7, 65, __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, 65, __pyx_L1_error)

  /* "pyarrow/memory.pxi":64
 *         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__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":70
 * 
 * 
 * def default_memory_pool():             # <<<<<<<<<<<<<<
 *     cdef:
 *         MemoryPool pool = MemoryPool.__new__(MemoryPool)
 */

/* 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()";
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":72
 * def default_memory_pool():
 *     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(7, 72, __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":73
 *     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":74
 *         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":70
 * 
 * 
 * def default_memory_pool():             # <<<<<<<<<<<<<<
 *     cdef:
 *         MemoryPool pool = MemoryPool.__new__(MemoryPool)
 */

  /* 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":77
 * 
 * 
 * def proxy_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Derived MemoryPool class that tracks the number of bytes and
 */

/* 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    Derived MemoryPool class that tracks the number of bytes and\n    maximum memory allocated through its direct calls.\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(7, 77, __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":82
 *     maximum memory allocated through its direct calls.
 *     """
 *     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(7, 82, __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":83
 *     """
 *     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":84
 *     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":85
 *     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":77
 * 
 * 
 * def proxy_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Derived MemoryPool class that tracks the number of bytes and
 */

  /* 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":88
 * 
 * 
 * def set_memory_pool(MemoryPool pool):             # <<<<<<<<<<<<<<
 *     c_set_default_memory_pool(pool.pool)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9set_memory_pool(PyObject *__pyx_self, PyObject *__pyx_v_pool); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8set_memory_pool[] = "set_memory_pool(MemoryPool pool)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_9set_memory_pool = {"set_memory_pool", (PyCFunction)__pyx_pw_7pyarrow_3lib_9set_memory_pool, METH_O, __pyx_doc_7pyarrow_3lib_8set_memory_pool};
static PyObject *__pyx_pw_7pyarrow_3lib_9set_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(7, 88, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_8set_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_8set_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":89
 * 
 * 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":88
 * 
 * 
 * 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":97
 * 
 * 
 * def log_memory_allocations(enable=True):             # <<<<<<<<<<<<<<
 *     """
 *     Enable or disable memory allocator logging for debugging purposes
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11log_memory_allocations(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10log_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_11log_memory_allocations = {"log_memory_allocations", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11log_memory_allocations, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10log_memory_allocations};
static PyObject *__pyx_pw_7pyarrow_3lib_11log_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(7, 97, __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(7, 97, __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_10log_memory_allocations(__pyx_self, __pyx_v_enable);

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

static PyObject *__pyx_pf_7pyarrow_3lib_10log_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":106
 *         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(7, 106, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/memory.pxi":107
 *     """
 *     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(7, 107, __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(7, 107, __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":106
 *         Pass False to disable logging
 *     """
 *     if enable:             # <<<<<<<<<<<<<<
 *         set_memory_pool(_logging_memory_pool)
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/memory.pxi":109
 *         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(7, 109, __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(7, 109, __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":97
 * 
 * 
 * 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":112
 * 
 * 
 * def total_allocated_bytes():             # <<<<<<<<<<<<<<
 *     cdef CMemoryPool* pool = c_get_memory_pool()
 *     return pool.bytes_allocated()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_13total_allocated_bytes(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12total_allocated_bytes[] = "total_allocated_bytes()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_13total_allocated_bytes = {"total_allocated_bytes", (PyCFunction)__pyx_pw_7pyarrow_3lib_13total_allocated_bytes, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12total_allocated_bytes};
static PyObject *__pyx_pw_7pyarrow_3lib_13total_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_12total_allocated_bytes(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_12total_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":113
 * 
 * def total_allocated_bytes():
 *     cdef CMemoryPool* pool = c_get_memory_pool()             # <<<<<<<<<<<<<<
 *     return pool.bytes_allocated()
 */
  __pyx_v_pool =  arrow::py::get_memory_pool();

  /* "pyarrow/memory.pxi":114
 * def total_allocated_bytes():
 *     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(7, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/memory.pxi":112
 * 
 * 
 * def total_allocated_bytes():             # <<<<<<<<<<<<<<
 *     cdef CMemoryPool* pool = c_get_memory_pool()
 *     return pool.bytes_allocated()
 */

  /* 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/types.pxi":62
 * 
 * 
 * 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":67
 *     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":68
 *     """
 *     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(3, 68, __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(3, 68, __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(3, 68, __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":67
 *     None is returned for unsupported types.
 *     """
 *     try:             # <<<<<<<<<<<<<<
 *         char = _pep3118_type_map[type.id()]
 *     except KeyError:
 */
    }

    /* "pyarrow/types.pxi":72
 *         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(3, 72, __pyx_L5_except_error)
      __pyx_t_7 = (__pyx_t_6 != 0);
      if (__pyx_t_7) {

        /* "pyarrow/types.pxi":74
 *         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__8, __pyx_v_char); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 74, __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(3, 74, __pyx_L5_except_error)
        __pyx_r = ((PyObject*)__pyx_t_5);
        __pyx_t_5 = 0;
        goto __pyx_L6_except_return;

        /* "pyarrow/types.pxi":72
 *         return None
 *     else:
 *         if char in b'bBhHiIqQ':             # <<<<<<<<<<<<<<
 *             # Use "standard" int widths, not native
 *             return b'=' + char
 */
      }

      /* "pyarrow/types.pxi":76
 *             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(3, 76, __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":69
 *     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(3, 69, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_9);

      /* "pyarrow/types.pxi":70
 *         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":67
 *     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":62
 * 
 * 
 * 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":79
 * 
 * 
 * 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_15_is_primitive(PyObject *__pyx_self, PyObject *__pyx_arg_type); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14_is_primitive[] = "_is_primitive(Type type)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_15_is_primitive = {"_is_primitive", (PyCFunction)__pyx_pw_7pyarrow_3lib_15_is_primitive, METH_O, __pyx_doc_7pyarrow_3lib_14_is_primitive};
static PyObject *__pyx_pw_7pyarrow_3lib_15_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(3, 79, __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_14_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_14_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":81
 * 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(3, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":79
 * 
 * 
 * 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":93
 *     Base type for Apache Arrow data type instances. Wraps C++ arrow::DataType
 *     """
 *     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":96
 *         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":99
 *         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):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Do_not_call_s_constructor_direct_3, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 99, __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(3, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 99, __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(3, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":97
 * 
 *     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(3, 97, __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(3, 97, __pyx_L1_error)

  /* "pyarrow/types.pxi":96
 *         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":101
 *                         "instead.".format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         self.sp_type = type
 *         self.type = type.get()
 */

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":102
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         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":103
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         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":104
 *         self.sp_type = type
 *         self.type = type.get()
 *         self.pep3118_format = _datatype_to_pep3118(self.type)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__datatype_to_pep3118(__pyx_v_self->type); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 104, __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":101
 *                         "instead.".format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         self.sp_type = type
 *         self.type = type.get()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_WriteUnraisable("pyarrow.lib.DataType.init", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/types.pxi":107
 * 
 *     @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":108
 *     @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(3, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":107
 * 
 *     @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":111
 * 
 *     @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":113
 *     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(3, 113, __pyx_L1_error)
  }
  __pyx_v_ty = __pyx_t_1;

  /* "pyarrow/types.pxi":114
 *         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":115
 *         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__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 115, __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(3, 115, __pyx_L1_error)

    /* "pyarrow/types.pxi":114
 *         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":116
 *         if ty == nullptr:
 *             raise ValueError("Non-fixed width type")
 *         return ty.bit_width()             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ty->bit_width()); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":111
 * 
 *     @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":118
 *         return ty.bit_width()
 * 
 *     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":119
 * 
 *     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(3, 119, __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(3, 119, __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(3, 119, __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":118
 *         return ty.bit_width()
 * 
 *     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":121
 *         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":122
 * 
 *     def __hash__(self):
 *         return hash(str(self))             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 122, __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(3, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":121
 *         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":124
 *         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":125
 * 
 *     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(3, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 125, __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(3, 125, __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":124
 *         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":127
 *         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":128
 * 
 *     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_s_0___class_____name___0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 128, __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(3, 128, __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":127
 *         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":130
 *         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":131
 * 
 *     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":132
 *     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(3, 132, __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(3, 132, __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":131
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except (TypeError, ValueError):
 */
    }
    __pyx_L3_error:;
    __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;

    /* "pyarrow/types.pxi":133
 *         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(3, 133, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/types.pxi":134
 *             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":131
 * 
 *     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":130
 *         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":136
 *             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":150
 *         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":151
 * 
 *         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(3, 151, __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(3, 151, __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(3, 151, __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":152
 *         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(3, 152, __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(3, 152, __pyx_L1_error)

      /* "pyarrow/types.pxi":151
 * 
 *         if not isinstance(other, DataType):
 *             if not isinstance(other, six.string_types):             # <<<<<<<<<<<<<<
 *                 raise TypeError(other)
 *             other_type = type_for_alias(other)
 */
    }

    /* "pyarrow/types.pxi":153
 *             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(3, 153, __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(3, 153, __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(3, 153, __pyx_L1_error)
    __pyx_v_other_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/types.pxi":150
 *         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":155
 *             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(3, 155, __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":157
 *             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(3, 157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":136
 *             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":159
 *         return self.type.Equals(deref(other_type.type))
 * 
 *     def to_pandas_dtype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the NumPy dtype that would be used for storing this
 */

/* 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 NumPy dtype that would be used for storing this\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":163
 *         Return the NumPy dtype that would be used for storing this
 *         """
 *         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":164
 *         """
 *         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(3, 164, __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(3, 164, __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(3, 164, __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":165
 *         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(3, 165, __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(3, 165, __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(3, 165, __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":164
 *         """
 *         cdef Type type_id = self.type.id()
 *         if type_id in _pandas_type_map:             # <<<<<<<<<<<<<<
 *             return _pandas_type_map[type_id]
 *         else:
 */
  }

  /* "pyarrow/types.pxi":167
 *             return _pandas_type_map[type_id]
 *         else:
 *             raise NotImplementedError(str(self))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 167, __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(3, 167, __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(3, 167, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":159
 *         return self.type.Equals(deref(other_type.type))
 * 
 *     def to_pandas_dtype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the NumPy dtype that would be used for storing this
 */

  /* 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":172
 * cdef class DictionaryType(DataType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         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":173
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         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);

  /* "pyarrow/types.pxi":174
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         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":172
 * cdef class DictionaryType(DataType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.dict_type = <const CDictionaryType*> type.get()
 */

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

/* "pyarrow/types.pxi":176
 *         self.dict_type = <const CDictionaryType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return dictionary, (self.index_type, self.dictionary, 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":177
 * 
 *     def __reduce__(self):
 *         return dictionary, (self.index_type, self.dictionary, self.ordered)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_dictionary); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 177, __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(3, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dictionary); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 177, __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(3, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 177, __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(3, 177, __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":176
 *         self.dict_type = <const CDictionaryType*> type.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return dictionary, (self.index_type, self.dictionary, 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":180
 * 
 *     @property
 *     def ordered(self):             # <<<<<<<<<<<<<<
 *         return self.dict_type.ordered()
 * 
 */

/* 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":181
 *     @property
 *     def ordered(self):
 *         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(3, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":180
 * 
 *     @property
 *     def ordered(self):             # <<<<<<<<<<<<<<
 *         return self.dict_type.ordered()
 * 
 */

  /* 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":184
 * 
 *     @property
 *     def index_type(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_data_type(self.dict_type.index_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":185
 *     @property
 *     def index_type(self):
 *         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(3, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":184
 * 
 *     @property
 *     def index_type(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_data_type(self.dict_type.index_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":188
 * 
 *     @property
 *     def dictionary(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(self.dict_type.dictionary())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_10dictionary_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_14DictionaryType_10dictionary_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_14DictionaryType_10dictionary___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_10dictionary___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":189
 *     @property
 *     def dictionary(self):
 *         return pyarrow_wrap_array(self.dict_type.dictionary())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_self->dict_type->dictionary()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":188
 * 
 *     @property
 *     def dictionary(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(self.dict_type.dictionary())
 * 
 */

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

/* "pyarrow/types.pxi":194
 * cdef class ListType(DataType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         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":195
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         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);

  /* "pyarrow/types.pxi":196
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         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":194
 * cdef class ListType(DataType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.list_type = <const CListType*> type.get()
 */

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

/* "pyarrow/types.pxi":198
 *         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":199
 * 
 *     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(3, 199, __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(3, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 199, __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(3, 199, __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":198
 *         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":202
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_data_type(self.list_type.value_type())
 * 
 */

/* 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":203
 *     @property
 *     def value_type(self):
 *         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(3, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":202
 * 
 *     @property
 *     def value_type(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_data_type(self.list_type.value_type())
 * 
 */

  /* 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":208
 * cdef class StructType(DataType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 * 
 */

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":209
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type);

  /* "pyarrow/types.pxi":208
 * cdef class StructType(DataType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 * 
 */

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

/* "pyarrow/types.pxi":211
 *         DataType.init(self, type)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.type.num_children()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_10StructType_1__len__(PyObject *__pyx_v_self); /*proto*/
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":212
 * 
 *     def __len__(self):
 *         return self.type.num_children()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_r = __pyx_v_self->__pyx_base.type->num_children();
  goto __pyx_L0;

  /* "pyarrow/types.pxi":211
 *         DataType.init(self, type)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.type.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":214
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self[i]
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_3__iter__(PyObject *__pyx_v_self); /*proto*/
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(3, 214, __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(3, 214, __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(3, 214, __pyx_L1_error)

  /* "pyarrow/types.pxi":215
 * 
 *     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(3, 215, __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":216
 *     def __iter__(self):
 *         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(3, 216, __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(3, 216, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/types.pxi":214
 *         return self.type.num_children()
 * 
 *     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":218
 *             yield self[i]
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         cdef int index = <int> _normalize_index(i, self.num_children)
 *         return pyarrow_wrap_field(self.type.child(index))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_6__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
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) {
  int __pyx_v_index;
  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;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/types.pxi":219
 * 
 *     def __getitem__(self, i):
 *         cdef int index = <int> _normalize_index(i, self.num_children)             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_field(self.type.child(index))
 * 
 */
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 219, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_children); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 219, __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(3, 219, __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(3, 219, __pyx_L1_error)
  __pyx_v_index = ((int)__pyx_t_4);

  /* "pyarrow/types.pxi":220
 *     def __getitem__(self, i):
 *         cdef int index = <int> _normalize_index(i, self.num_children)
 *         return pyarrow_wrap_field(self.type.child(index))             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_self->__pyx_base.type->child(__pyx_v_index)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":218
 *             yield self[i]
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         cdef int index = <int> _normalize_index(i, self.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.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":222
 *         return pyarrow_wrap_field(self.type.child(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":223
 * 
 *     def __reduce__(self):
 *         return struct, (list(self),)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_struct); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 223, __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(3, 223, __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":222
 *         return pyarrow_wrap_field(self.type.child(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":226
 * 
 *     @property
 *     def num_children(self):             # <<<<<<<<<<<<<<
 *         return self.type.num_children()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_12num_children_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10StructType_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_10StructType_12num_children___get__(((struct __pyx_obj_7pyarrow_3lib_StructType *)__pyx_v_self));

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

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

  /* "pyarrow/types.pxi":227
 *     @property
 *     def num_children(self):
 *         return self.type.num_children()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.type->num_children()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":226
 * 
 *     @property
 *     def num_children(self):             # <<<<<<<<<<<<<<
 *         return self.type.num_children()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.StructType.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":232
 * cdef class UnionType(DataType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         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":233
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         DataType.init(self, type)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_f_7pyarrow_3lib_8DataType_init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_self), __pyx_v_type);

  /* "pyarrow/types.pxi":232
 * cdef class UnionType(DataType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 * 
 */

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

/* "pyarrow/types.pxi":236
 * 
 *     @property
 *     def num_children(self):             # <<<<<<<<<<<<<<
 *         return self.type.num_children()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_12num_children_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_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_9UnionType_12num_children___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_12num_children___get__(struct __pyx_obj_7pyarrow_3lib_UnionType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":237
 *     @property
 *     def num_children(self):
 *         return self.type.num_children()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.type->num_children()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 237, __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 num_children(self):             # <<<<<<<<<<<<<<
 *         return self.type.num_children()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.UnionType.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":240
 * 
 *     @property
 *     def mode(self):             # <<<<<<<<<<<<<<
 *         cdef CUnionType* type = <CUnionType*> self.sp_type.get()
 *         cdef int mode = type.mode()
 */

/* 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":241
 *     @property
 *     def mode(self):
 *         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":242
 *     def mode(self):
 *         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":243
 *         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":244
 *         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_s_dense);
    __pyx_r = __pyx_n_s_dense;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":243
 *         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":245
 *         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":246
 *             return 'dense'
 *         if mode == _UnionMode_SPARSE:
 *             return 'sparse'             # <<<<<<<<<<<<<<
 *         assert 0
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_s_sparse);
    __pyx_r = __pyx_n_s_sparse;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":245
 *         if mode == _UnionMode_DENSE:
 *             return 'dense'
 *         if mode == _UnionMode_SPARSE:             # <<<<<<<<<<<<<<
 *             return 'sparse'
 *         assert 0
 */
  }

  /* "pyarrow/types.pxi":247
 *         if mode == _UnionMode_SPARSE:
 *             return 'sparse'
 *         assert 0             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!0)) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(3, 247, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/types.pxi":240
 * 
 *     @property
 *     def mode(self):             # <<<<<<<<<<<<<<
 *         cdef CUnionType* type = <CUnionType*> self.sp_type.get()
 *         cdef int mode = type.mode()
 */

  /* 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":249
 *         assert 0
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.type.num_children()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_9UnionType_1__len__(PyObject *__pyx_v_self); /*proto*/
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":250
 * 
 *     def __len__(self):
 *         return self.type.num_children()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_r = __pyx_v_self->__pyx_base.type->num_children();
  goto __pyx_L0;

  /* "pyarrow/types.pxi":249
 *         assert 0
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.type.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":252
 *         return self.type.num_children()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self[i]
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_3__iter__(PyObject *__pyx_v_self); /*proto*/
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(3, 252, __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(3, 252, __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(3, 252, __pyx_L1_error)

  /* "pyarrow/types.pxi":253
 * 
 *     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(3, 253, __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":254
 *     def __iter__(self):
 *         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(3, 254, __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(3, 254, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/types.pxi":252
 *         return self.type.num_children()
 * 
 *     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":256
 *             yield self[i]
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         cdef int index = <int> _normalize_index(i, self.num_children)
 *         return pyarrow_wrap_field(self.type.child(index))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9UnionType_6__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
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) {
  int __pyx_v_index;
  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;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/types.pxi":257
 * 
 *     def __getitem__(self, i):
 *         cdef int index = <int> _normalize_index(i, self.num_children)             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_field(self.type.child(index))
 * 
 */
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 257, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_children); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 257, __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(3, 257, __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(3, 257, __pyx_L1_error)
  __pyx_v_index = ((int)__pyx_t_4);

  /* "pyarrow/types.pxi":258
 *     def __getitem__(self, i):
 *         cdef int index = <int> _normalize_index(i, self.num_children)
 *         return pyarrow_wrap_field(self.type.child(index))             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_self->__pyx_base.type->child(__pyx_v_index)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":256
 *             yield self[i]
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         cdef int index = <int> _normalize_index(i, self.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.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":260
 *         return pyarrow_wrap_field(self.type.child(index))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return union, (list(self), self.mode)
 * 
 */

/* 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;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pyarrow/types.pxi":261
 * 
 *     def __reduce__(self):
 *         return union, (list(self), self.mode)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_union); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 261, __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(3, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 261, __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(3, 261, __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":260
 *         return pyarrow_wrap_field(self.type.child(index))
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return union, (list(self), self.mode)
 * 
 */

  /* 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.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":266
 * cdef class TimestampType(DataType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         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":267
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         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);

  /* "pyarrow/types.pxi":268
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         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":266
 * cdef class TimestampType(DataType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.ts_type = <const CTimestampType*> type.get()
 */

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

/* "pyarrow/types.pxi":271
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         return timeunit_to_string(self.ts_type.unit())
 * 
 */

/* 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":272
 *     @property
 *     def unit(self):
 *         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(3, 272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":271
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         return timeunit_to_string(self.ts_type.unit())
 * 
 */

  /* 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":275
 * 
 *     @property
 *     def tz(self):             # <<<<<<<<<<<<<<
 *         if self.ts_type.timezone().size() > 0:
 *             return frombytes(self.ts_type.timezone())
 */

/* 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":276
 *     @property
 *     def tz(self):
 *         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":277
 *     def tz(self):
 *         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(3, 277, __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(3, 277, __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(3, 277, __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":276
 *     @property
 *     def tz(self):
 *         if self.ts_type.timezone().size() > 0:             # <<<<<<<<<<<<<<
 *             return frombytes(self.ts_type.timezone())
 *         else:
 */
  }

  /* "pyarrow/types.pxi":279
 *             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":275
 * 
 *     @property
 *     def tz(self):             # <<<<<<<<<<<<<<
 *         if self.ts_type.timezone().size() > 0:
 *             return frombytes(self.ts_type.timezone())
 */

  /* 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":281
 *             return None
 * 
 *     def to_pandas_dtype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the NumPy dtype that would be used for storing this
 */

/* 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 NumPy dtype that would be used for storing this\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_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":285
 *         Return the NumPy dtype that would be used for storing this
 *         """
 *         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(3, 285, __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":286
 *         """
 *         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(3, 286, __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(3, 286, __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(3, 286, __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":285
 *         Return the NumPy dtype that would be used for storing this
 *         """
 *         if self.tz is None:             # <<<<<<<<<<<<<<
 *             return _pandas_type_map[_Type_TIMESTAMP]
 *         else:
 */
  }

  /* "pyarrow/types.pxi":289
 *         else:
 *             # Return DatetimeTZ
 *             return pdcompat.make_datetimetz(self.tz)             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pdcompat); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_make_datetimetz); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tz); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __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_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_4)) __PYX_ERR(3, 289, __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/types.pxi":281
 *             return None
 * 
 *     def to_pandas_dtype(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the NumPy dtype that would be used for storing this
 */

  /* 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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":291
 *             return pdcompat.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":292
 * 
 *     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(3, 292, __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(3, 292, __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(3, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 292, __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(3, 292, __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":291
 *             return pdcompat.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":297
 * cdef class Time32Type(DataType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         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":298
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         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);

  /* "pyarrow/types.pxi":299
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         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":297
 * cdef class Time32Type(DataType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.time_type = <const CTime32Type*> type.get()
 */

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

/* "pyarrow/types.pxi":302
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         return timeunit_to_string(self.time_type.unit())
 * 
 */

/* 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":303
 *     @property
 *     def unit(self):
 *         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(3, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":302
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         return timeunit_to_string(self.time_type.unit())
 * 
 */

  /* 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":308
 * cdef class Time64Type(DataType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         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":309
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         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);

  /* "pyarrow/types.pxi":310
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         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":308
 * cdef class Time64Type(DataType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.time_type = <const CTime64Type*> type.get()
 */

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

/* "pyarrow/types.pxi":313
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         return timeunit_to_string(self.time_type.unit())
 * 
 */

/* 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":314
 *     @property
 *     def unit(self):
 *         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(3, 314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":313
 * 
 *     @property
 *     def unit(self):             # <<<<<<<<<<<<<<
 *         return timeunit_to_string(self.time_type.unit())
 * 
 */

  /* 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":319
 * cdef class FixedSizeBinaryType(DataType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         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":320
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         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);

  /* "pyarrow/types.pxi":321
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         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":319
 * cdef class FixedSizeBinaryType(DataType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         DataType.init(self, type)
 *         self.fixed_size_binary_type = (
 */

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

/* "pyarrow/types.pxi":324
 *             <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":325
 * 
 *     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(3, 325, __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(3, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 325, __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(3, 325, __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":324
 *             <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":328
 * 
 *     @property
 *     def byte_width(self):             # <<<<<<<<<<<<<<
 *         return self.fixed_size_binary_type.byte_width()
 * 
 */

/* 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":329
 *     @property
 *     def byte_width(self):
 *         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(3, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":328
 * 
 *     @property
 *     def byte_width(self):             # <<<<<<<<<<<<<<
 *         return self.fixed_size_binary_type.byte_width()
 * 
 */

  /* 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":334
 * cdef class Decimal128Type(FixedSizeBinaryType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         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":335
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         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);

  /* "pyarrow/types.pxi":336
 *     cdef void init(self, const shared_ptr[CDataType]& type):
 *         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":334
 * cdef class Decimal128Type(FixedSizeBinaryType):
 * 
 *     cdef void init(self, const shared_ptr[CDataType]& type):             # <<<<<<<<<<<<<<
 *         FixedSizeBinaryType.init(self, type)
 *         self.decimal128_type = <const CDecimal128Type*> type.get()
 */

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

/* "pyarrow/types.pxi":338
 *         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":339
 * 
 *     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(3, 339, __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(3, 339, __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(3, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 339, __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(3, 339, __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":338
 *         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":342
 * 
 *     @property
 *     def precision(self):             # <<<<<<<<<<<<<<
 *         return self.decimal128_type.precision()
 * 
 */

/* 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":343
 *     @property
 *     def precision(self):
 *         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(3, 343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":342
 * 
 *     @property
 *     def precision(self):             # <<<<<<<<<<<<<<
 *         return self.decimal128_type.precision()
 * 
 */

  /* 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":346
 * 
 *     @property
 *     def scale(self):             # <<<<<<<<<<<<<<
 *         return self.decimal128_type.scale()
 * 
 */

/* 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":347
 *     @property
 *     def scale(self):
 *         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(3, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":346
 * 
 *     @property
 *     def scale(self):             # <<<<<<<<<<<<<<
 *         return self.decimal128_type.scale()
 * 
 */

  /* 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":359
 *     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":362
 *         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":363
 * 
 *     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__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 363, __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(3, 363, __pyx_L1_error)

  /* "pyarrow/types.pxi":362
 *         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":366
 *                         "`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":367
 * 
 *     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":368
 *     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":369
 *         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(3, 369, __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(3, 369, __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":366
 *                         "`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":371
 *         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(3, 371, __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":383
 *         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(3, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":371
 *         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":385
 *         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":386
 * 
 *     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":387
 *     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(3, 387, __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(3, 387, __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":386
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    }
    __pyx_L3_error:;
    __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;

    /* "pyarrow/types.pxi":388
 *         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(3, 388, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/types.pxi":389
 *             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":386
 * 
 *     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":385
 *         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":391
 *             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":392
 * 
 *     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(3, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 392, __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(3, 392, __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(3, 392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 392, __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(3, 392, __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":391
 *             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":394
 *         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":395
 * 
 *     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_s_pyarrow_Field_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 395, __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(3, 395, __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(3, 395, __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(3, 395, __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":394
 *         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":397
 *         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":398
 * 
 *     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(3, 398, __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(3, 398, __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":397
 *         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":400
 *         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":401
 * 
 *     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(3, 401, __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(3, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 401, __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(3, 401, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":400
 *         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":404
 * 
 *     @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":405
 *     @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(3, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":404
 * 
 *     @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":408
 * 
 *     @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":409
 *     @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(3, 409, __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(3, 409, __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(3, 409, __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":408
 * 
 *     @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":412
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[const CKeyValueMetadata] 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) {
  std::shared_ptr< arrow::KeyValueMetadata const >  __pyx_v_metadata;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":414
 *     def metadata(self):
 *         cdef shared_ptr[const CKeyValueMetadata] metadata = (
 *             self.field.metadata())             # <<<<<<<<<<<<<<
 *         return box_metadata(metadata.get())
 * 
 */
  __pyx_v_metadata = __pyx_v_self->field->metadata();

  /* "pyarrow/types.pxi":415
 *         cdef shared_ptr[const CKeyValueMetadata] metadata = (
 *             self.field.metadata())
 *         return box_metadata(metadata.get())             # <<<<<<<<<<<<<<
 * 
 *     def add_metadata(self, dict metadata):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_box_metadata(__pyx_v_metadata.get()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":412
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[const CKeyValueMetadata] 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":417
 *         return box_metadata(metadata.get())
 * 
 *     def add_metadata(self, dict metadata):             # <<<<<<<<<<<<<<
 *         """
 *         Add metadata as dict of string keys and values to Field
 */

/* 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, dict 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_17add_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_metadata (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metadata), (&PyDict_Type), 1, "metadata", 1))) __PYX_ERR(3, 417, __pyx_L1_error)
  __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 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __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) {
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  std::shared_ptr< arrow::Field>  __pyx_v_new_field;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("add_metadata", 0);

  /* "pyarrow/types.pxi":431
 *         """
 *         cdef shared_ptr[CKeyValueMetadata] c_meta
 *         convert_metadata(metadata, &c_meta)             # <<<<<<<<<<<<<<
 * 
 *         cdef shared_ptr[CField] new_field
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_convert_metadata(__pyx_v_metadata, (&__pyx_v_c_meta)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 431, __pyx_L1_error)

  /* "pyarrow/types.pxi":434
 * 
 *         cdef shared_ptr[CField] new_field
 *         with nogil:             # <<<<<<<<<<<<<<
 *             new_field = self.field.AddMetadata(c_meta)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":435
 *         cdef shared_ptr[CField] new_field
 *         with nogil:
 *             new_field = self.field.AddMetadata(c_meta)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_field(new_field)
 */
        __pyx_v_new_field = __pyx_v_self->field->AddMetadata(__pyx_v_c_meta);
      }

      /* "pyarrow/types.pxi":434
 * 
 *         cdef shared_ptr[CField] new_field
 *         with nogil:             # <<<<<<<<<<<<<<
 *             new_field = self.field.AddMetadata(c_meta)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":437
 *             new_field = self.field.AddMetadata(c_meta)
 * 
 *         return pyarrow_wrap_field(new_field)             # <<<<<<<<<<<<<<
 * 
 *     def remove_metadata(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_new_field); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 437, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":417
 *         return box_metadata(metadata.get())
 * 
 *     def add_metadata(self, dict metadata):             # <<<<<<<<<<<<<<
 *         """
 *         Add metadata as dict of string keys and values to Field
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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":439
 *         return pyarrow_wrap_field(new_field)
 * 
 *     def remove_metadata(self):             # <<<<<<<<<<<<<<
 *         """
 *         Create new field without metadata, if any
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Field_19remove_metadata(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Field_18remove_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_19remove_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_18remove_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_18remove_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":448
 *         """
 *         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":449
 *         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":448
 *         """
 *         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":450
 *         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(3, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":439
 *         return pyarrow_wrap_field(new_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":452
 *         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_21flatten(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Field_20flatten[] = "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_21flatten(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_20flatten(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Field_20flatten(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_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":462
 *         """
 *         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":463
 *         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":462
 *         """
 *         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":464
 *         with nogil:
 *             flattened = self.field.Flatten()
 *         return [pyarrow_wrap_field(f) for f in flattened]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 464, __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_v_f = __pyx_t_3;
    __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_f); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(3, 464, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":452
 *         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":97
 * 
 *     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":469
 * 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":472
 *         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":473
 * 
 *     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__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 473, __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(3, 473, __pyx_L1_error)

  /* "pyarrow/types.pxi":472
 *         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":476
 *                         "`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":477
 * 
 *     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":476
 *                         "`pyarrow.schema` instead.")
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.schema.num_fields()
 * 
 */

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

/* "pyarrow/types.pxi":479
 *         return self.schema.num_fields()
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         cdef int index = <int> _normalize_index(key, self.schema.num_fields())
 *         return pyarrow_wrap_field(self.schema.field(index))
 */

/* 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) {
  int __pyx_v_index;
  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/types.pxi":480
 * 
 *     def __getitem__(self, key):
 *         cdef int index = <int> _normalize_index(key, self.schema.num_fields())             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_field(self.schema.field(index))
 * 
 */
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 480, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_1, __pyx_v_self->schema->num_fields()); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1L))) __PYX_ERR(3, 480, __pyx_L1_error)
  __pyx_v_index = ((int)__pyx_t_2);

  /* "pyarrow/types.pxi":481
 *     def __getitem__(self, key):
 *         cdef int index = <int> _normalize_index(key, self.schema.num_fields())
 *         return pyarrow_wrap_field(self.schema.field(index))             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_self->schema->field(__pyx_v_index)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":479
 *         return self.schema.num_fields()
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         cdef int index = <int> _normalize_index(key, self.schema.num_fields())
 *         return pyarrow_wrap_field(self.schema.field(index))
 */

  /* function exit code */
  __pyx_L1_error:;
  __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":483
 *         return pyarrow_wrap_field(self.schema.field(index))
 * 
 *     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(3, 483, __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(3, 483, __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(3, 483, __pyx_L1_error)

  /* "pyarrow/types.pxi":484
 * 
 *     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(3, 484, __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":485
 *     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(3, 485, __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(3, 485, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/types.pxi":483
 *         return pyarrow_wrap_field(self.schema.field(index))
 * 
 *     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":487
 *             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":488
 * 
 *     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":489
 *     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":487
 *             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":491
 *         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":492
 * 
 *     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":493
 *     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":491
 *         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":495
 *         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":496
 * 
 *     def __reduce__(self):
 *         return schema, (list(self), self.metadata)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_schema); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PySequence_List(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 496, __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(3, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 496, __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(3, 496, __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":495
 *         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":499
 * 
 *     @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":508
 *         """
 *         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(3, 508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":509
 *         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":510
 *         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(3, 510, __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(3, 510, __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(3, 510, __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":511
 *         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(3, 511, __pyx_L1_error)
  }

  /* "pyarrow/types.pxi":512
 *             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":499
 * 
 *     @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":515
 * 
 *     @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_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":523
 *         list of DataType
 *         """
 *         return [field.type for field in self]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 523, __pyx_L1_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(3, 523, __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(3, 523, __pyx_L1_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(3, 523, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 523, __pyx_L1_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(3, 523, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 523, __pyx_L1_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(3, 523, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_field, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_field, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(3, 523, __pyx_L1_error)
    __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/types.pxi":515
 * 
 *     @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_v_field);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":526
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[const CKeyValueMetadata] 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) {
  std::shared_ptr< arrow::KeyValueMetadata const >  __pyx_v_metadata;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/types.pxi":528
 *     def metadata(self):
 *         cdef shared_ptr[const CKeyValueMetadata] metadata = (
 *             self.schema.metadata())             # <<<<<<<<<<<<<<
 *         return box_metadata(metadata.get())
 * 
 */
  __pyx_v_metadata = __pyx_v_self->schema->metadata();

  /* "pyarrow/types.pxi":529
 *         cdef shared_ptr[const CKeyValueMetadata] metadata = (
 *             self.schema.metadata())
 *         return box_metadata(metadata.get())             # <<<<<<<<<<<<<<
 * 
 *     def __eq__(self, other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_box_metadata(__pyx_v_metadata.get()); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":526
 * 
 *     @property
 *     def metadata(self):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[const CKeyValueMetadata] 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":531
 *         return box_metadata(metadata.get())
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         try:
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_14__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_14__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_13__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_13__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":532
 * 
 *     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":533
 *     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(3, 533, __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(3, 533, __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":532
 * 
 *     def __eq__(self, other):
 *         try:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         except TypeError:
 */
    }
    __pyx_L3_error:;
    __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;

    /* "pyarrow/types.pxi":534
 *         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(3, 534, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "pyarrow/types.pxi":535
 *             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":532
 * 
 *     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":531
 *         return box_metadata(metadata.get())
 * 
 *     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":537
 *             return NotImplemented
 * 
 *     def empty_table(self):             # <<<<<<<<<<<<<<
 *         """
 *         Provide an empty table according to the schema.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_16empty_table(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_15empty_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_16empty_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_15empty_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_15empty_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":545
 *         table: pyarrow.Table
 *         """
 *         arrays = []             # <<<<<<<<<<<<<<
 *         names = []
 *         for field in self:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_arrays = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":546
 *         """
 *         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(3, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_names = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":547
 *         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(3, 547, __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(3, 547, __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(3, 547, __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(3, 547, __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(3, 547, __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(3, 547, __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(3, 547, __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":548
 *         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(3, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 548, __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(3, 548, __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(3, 548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_type, __pyx_t_7) < 0) __PYX_ERR(3, 548, __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(3, 548, __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(3, 548, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyarrow/types.pxi":549
 *         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_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 549, __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(3, 549, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pyarrow/types.pxi":547
 *         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":550
 *             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(3, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/types.pxi":551
 *             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(3, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_arrays, __pyx_v_arrays) < 0) __PYX_ERR(3, 551, __pyx_L1_error)

  /* "pyarrow/types.pxi":552
 *         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(3, 551, __pyx_L1_error)

  /* "pyarrow/types.pxi":553
 *             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(3, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_metadata, __pyx_t_5) < 0) __PYX_ERR(3, 551, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":550
 *             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(3, 550, __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":537
 *             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":556
 *         )
 * 
 *     def equals(self, other, bint check_metadata=True):             # <<<<<<<<<<<<<<
 *         """
 *         Test if this schema is equal to the other
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_18equals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_17equals[] = "Schema.equals(self, 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_18equals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__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(3, 556, __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 = 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(3, 556, __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(3, 556, __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:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_17equals(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), __pyx_v_other, __pyx_v_check_metadata);

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_17equals(struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_check_metadata) {
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v__other = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/types.pxi":570
 *         is_equal : boolean
 *         """
 *         cdef Schema _other = other             # <<<<<<<<<<<<<<
 *         return self.sp_schema.get().Equals(deref(_other.schema),
 *                                            check_metadata)
 */
  if (!(likely(((__pyx_v_other) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_7pyarrow_3lib_Schema))))) __PYX_ERR(3, 570, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_other;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v__other = ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":571
 *         """
 *         cdef Schema _other = other
 *         return self.sp_schema.get().Equals(deref(_other.schema),             # <<<<<<<<<<<<<<
 *                                            check_metadata)
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/types.pxi":572
 *         cdef Schema _other = other
 *         return self.sp_schema.get().Equals(deref(_other.schema),
 *                                            check_metadata)             # <<<<<<<<<<<<<<
 * 
 *     def field_by_name(self, name):
 */
  __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(3, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":556
 *         )
 * 
 *     def equals(self, other, 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_XDECREF((PyObject *)__pyx_v__other);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":574
 *                                            check_metadata)
 * 
 *     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_20field_by_name(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_19field_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_20field_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_19field_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_19field_by_name(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("field_by_name", 0);

  /* "pyarrow/types.pxi":586
 *         field: pyarrow.Field
 *         """
 *         return pyarrow_wrap_field(self.schema.GetFieldByName(tobytes(name)))             # <<<<<<<<<<<<<<
 * 
 *     def get_field_index(self, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 586, __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(3, 586, __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(3, 586, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_self->schema->GetFieldByName(__pyx_t_4)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":574
 *                                            check_metadata)
 * 
 *     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":588
 *         return pyarrow_wrap_field(self.schema.GetFieldByName(tobytes(name)))
 * 
 *     def get_field_index(self, name):             # <<<<<<<<<<<<<<
 *         return self.schema.GetFieldIndex(tobytes(name))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_22get_field_index(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_21get_field_index[] = "Schema.get_field_index(self, name)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_22get_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_21get_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_21get_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":589
 * 
 *     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(3, 589, __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(3, 589, __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(3, 589, __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(3, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":588
 *         return pyarrow_wrap_field(self.schema.GetFieldByName(tobytes(name)))
 * 
 *     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":591
 *         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_24append(PyObject *__pyx_v_self, PyObject *__pyx_v_field); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_23append[] = "Schema.append(self, Field field)\n\n        Append a field at the end of the schema.\n\n        Parameters\n        ----------\n        field: Field\n\n        Returns\n        -------\n        schema: Schema\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_24append(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(3, 591, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_23append(((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_23append(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":603
 *         schema: Schema
 *         """
 *         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(3, 603, __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(3, 603, __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(3, 603, __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(3, 603, __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(3, 603, __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(3, 603, __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":591
 *         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":605
 *         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_26insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_25insert[] = "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_26insert(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(3, 605, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 605, __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(3, 605, __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(3, 605, __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(3, 605, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_25insert(((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_25insert(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":622
 *             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":624
 *         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":625
 * 
 *         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(3, 625, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":624
 *         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":627
 *             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(3, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":605
 *         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":629
 *         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_28remove(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_27remove[] = "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_28remove(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(3, 629, __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_27remove(((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_27remove(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":643
 *         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":644
 * 
 *         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(3, 644, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":643
 *         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":646
 *             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(3, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":629
 *         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":648
 *         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_30set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_29set[] = "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_30set(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(3, 648, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(3, 648, __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(3, 648, __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(3, 648, __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(3, 648, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_29set(((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_29set(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":665
 *             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":667
 *         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":668
 * 
 *         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(3, 668, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":667
 *         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":670
 *             check_status(self.schema.SetField(i, c_field, &new_schema))
 * 
 *         return pyarrow_wrap_schema(new_schema)             # <<<<<<<<<<<<<<
 * 
 *     def add_metadata(self, dict 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(3, 670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":648
 *         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":672
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def add_metadata(self, dict metadata):             # <<<<<<<<<<<<<<
 *         """
 *         Add metadata as dict of string keys and values to Schema
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_32add_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_31add_metadata[] = "Schema.add_metadata(self, dict 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_32add_metadata(PyObject *__pyx_v_self, PyObject *__pyx_v_metadata) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_metadata (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metadata), (&PyDict_Type), 1, "metadata", 1))) __PYX_ERR(3, 672, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_31add_metadata(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), ((PyObject*)__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_6Schema_31add_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_new_schema;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("add_metadata", 0);

  /* "pyarrow/types.pxi":686
 *         """
 *         cdef shared_ptr[CKeyValueMetadata] c_meta
 *         convert_metadata(metadata, &c_meta)             # <<<<<<<<<<<<<<
 * 
 *         cdef shared_ptr[CSchema] new_schema
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_convert_metadata(__pyx_v_metadata, (&__pyx_v_c_meta)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 686, __pyx_L1_error)

  /* "pyarrow/types.pxi":689
 * 
 *         cdef shared_ptr[CSchema] new_schema
 *         with nogil:             # <<<<<<<<<<<<<<
 *             new_schema = self.schema.AddMetadata(c_meta)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":690
 *         cdef shared_ptr[CSchema] new_schema
 *         with nogil:
 *             new_schema = self.schema.AddMetadata(c_meta)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_schema(new_schema)
 */
        __pyx_v_new_schema = __pyx_v_self->schema->AddMetadata(__pyx_v_c_meta);
      }

      /* "pyarrow/types.pxi":689
 * 
 *         cdef shared_ptr[CSchema] new_schema
 *         with nogil:             # <<<<<<<<<<<<<<
 *             new_schema = self.schema.AddMetadata(c_meta)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/types.pxi":692
 *             new_schema = self.schema.AddMetadata(c_meta)
 * 
 *         return pyarrow_wrap_schema(new_schema)             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self, memory_pool=None):
 */
  __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(3, 692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":672
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def add_metadata(self, dict metadata):             # <<<<<<<<<<<<<<
 *         """
 *         Add metadata as dict of string keys and values to Schema
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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":694
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def serialize(self, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write Schema to Buffer as encapsulated IPC message
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_34serialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_33serialize[] = "Schema.serialize(self, 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\n        Returns\n        -------\n        serialized : Buffer\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_34serialize(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(3, 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_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(3, 694, __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:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_33serialize(((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_self), __pyx_v_memory_pool);

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Schema_33serialize(struct __pyx_obj_7pyarrow_3lib_Schema *__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/types.pxi":709
 *         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(3, 709, __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":711
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(SerializeSchema(deref(self.schema),
 *                                          pool, &buffer))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":712
 * 
 *         with nogil:
 *             check_status(SerializeSchema(deref(self.schema),             # <<<<<<<<<<<<<<
 *                                          pool, &buffer))
 *         return pyarrow_wrap_buffer(buffer)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::SerializeSchema((*__pyx_v_self->schema), __pyx_v_pool, (&__pyx_v_buffer))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 712, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":711
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(SerializeSchema(deref(self.schema),
 *                                          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/types.pxi":714
 *             check_status(SerializeSchema(deref(self.schema),
 *                                          pool, &buffer))
 *         return pyarrow_wrap_buffer(buffer)             # <<<<<<<<<<<<<<
 * 
 *     def remove_metadata(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":694
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def serialize(self, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write Schema to Buffer as encapsulated IPC message
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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":716
 *         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_36remove_metadata(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Schema_35remove_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_36remove_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_35remove_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_35remove_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":725
 *         """
 *         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":726
 *         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":725
 *         """
 *         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":727
 *         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(3, 727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":716
 *         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":729
 *         return pyarrow_wrap_schema(new_schema)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             c_string result
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_38__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_38__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_37__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_37__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":733
 *             c_string result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 PrettyPrint(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/types.pxi":734
 * 
 *         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(3, 734, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":733
 *             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":742
 *             )
 * 
 *         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(3, 742, __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(3, 742, __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(3, 742, __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":743
 * 
 *         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(3, 743, __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":744
 *         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, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_pprint = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/types.pxi":745
 *         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(3, 745, __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(3, 745, __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(3, 745, __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":746
 *             import pprint
 *             metadata_formatted = pprint.pformat(self.metadata)
 *             printed += '\nmetadata\n--------\n' + metadata_formatted             # <<<<<<<<<<<<<<
 * 
 *         return printed
 */
    __pyx_t_2 = PyNumber_Add(__pyx_kp_s_metadata_2, __pyx_v_metadata_formatted); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 746, __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(3, 746, __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":743
 * 
 *         printed = frombytes(result)
 *         if self.metadata is not None:             # <<<<<<<<<<<<<<
 *             import pprint
 *             metadata_formatted = pprint.pformat(self.metadata)
 */
  }

  /* "pyarrow/types.pxi":748
 *             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":729
 *         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":750
 *         return printed
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return self.__str__()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_40__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Schema_40__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Schema_39__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_39__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":751
 * 
 *     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(3, 751, __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(3, 751, __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":750
 *         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":754
 * 
 * 
 * cdef dict box_metadata(const CKeyValueMetadata* metadata):             # <<<<<<<<<<<<<<
 *     cdef unordered_map[c_string, c_string] result
 *     if metadata != nullptr:
 */

static PyObject *__pyx_f_7pyarrow_3lib_box_metadata( arrow::KeyValueMetadata const *__pyx_v_metadata) {
  std::unordered_map<std::string,std::string>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("box_metadata", 0);

  /* "pyarrow/types.pxi":756
 * cdef dict box_metadata(const CKeyValueMetadata* metadata):
 *     cdef unordered_map[c_string, c_string] result
 *     if metadata != nullptr:             # <<<<<<<<<<<<<<
 *         metadata.ToUnorderedMap(&result)
 *         return result
 */
  __pyx_t_1 = ((__pyx_v_metadata != nullptr) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":757
 *     cdef unordered_map[c_string, c_string] result
 *     if metadata != nullptr:
 *         metadata.ToUnorderedMap(&result)             # <<<<<<<<<<<<<<
 *         return result
 *     else:
 */
    __pyx_v_metadata->ToUnorderedMap((&__pyx_v_result));

    /* "pyarrow/types.pxi":758
 *     if metadata != nullptr:
 *         metadata.ToUnorderedMap(&result)
 *         return result             # <<<<<<<<<<<<<<
 *     else:
 *         return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (!(likely(PyDict_CheckExact(__pyx_t_2))||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 758, __pyx_L1_error)
    __pyx_r = ((PyObject*)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":756
 * cdef dict box_metadata(const CKeyValueMetadata* metadata):
 *     cdef unordered_map[c_string, c_string] result
 *     if metadata != nullptr:             # <<<<<<<<<<<<<<
 *         metadata.ToUnorderedMap(&result)
 *         return result
 */
  }

  /* "pyarrow/types.pxi":760
 *         return result
 *     else:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":754
 * 
 * 
 * cdef dict box_metadata(const CKeyValueMetadata* metadata):             # <<<<<<<<<<<<<<
 *     cdef unordered_map[c_string, c_string] result
 *     if metadata != nullptr:
 */

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

/* "pyarrow/types.pxi":766
 * 
 * 
 * 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":767
 * 
 * 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(3, 767, __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(3, 767, __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(3, 767, __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":768
 * 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(3, 768, __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(3, 768, __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(3, 768, __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(3, 768, __pyx_L1_error)
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":767
 * 
 * cdef DataType primitive_type(Type type):
 *     if type in _type_cache:             # <<<<<<<<<<<<<<
 *         return _type_cache[type]
 * 
 */
  }

  /* "pyarrow/types.pxi":770
 *         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(3, 770, __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":771
 * 
 *     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));

  /* "pyarrow/types.pxi":773
 *     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(3, 773, __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(3, 773, __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(3, 773, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":774
 * 
 *     _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":766
 * 
 * 
 * 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":779
 * # Type factory functions
 * 
 * cdef int convert_metadata(dict metadata,             # <<<<<<<<<<<<<<
 *                           shared_ptr[CKeyValueMetadata]* out) except -1:
 *     cdef:
 */

static int __pyx_f_7pyarrow_3lib_convert_metadata(PyObject *__pyx_v_metadata, std::shared_ptr< arrow::KeyValueMetadata>  *__pyx_v_out) {
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_meta;
  std::string __pyx_v_key;
  std::string __pyx_v_value;
  PyObject *__pyx_v_py_key = NULL;
  PyObject *__pyx_v_py_value = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_t_1;
  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)(PyObject *);
  std::string __pyx_t_10;
  __Pyx_RefNannySetupContext("convert_metadata", 0);

  /* "pyarrow/types.pxi":783
 *     cdef:
 *         shared_ptr[CKeyValueMetadata] meta = (
 *             make_shared[CKeyValueMetadata]())             # <<<<<<<<<<<<<<
 *         c_string key, value
 * 
 */
  try {
    __pyx_t_1 = std::make_shared< arrow::KeyValueMetadata>();
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 783, __pyx_L1_error)
  }
  __pyx_v_meta = __pyx_t_1;

  /* "pyarrow/types.pxi":786
 *         c_string key, value
 * 
 *     for py_key, py_value in metadata.items():             # <<<<<<<<<<<<<<
 *         key = tobytes(py_key)
 *         value = tobytes(py_value)
 */
  if (unlikely(__pyx_v_metadata == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(3, 786, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyDict_Items(__pyx_v_metadata); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 786, __pyx_L1_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(3, 786, __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(3, 786, __pyx_L1_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(3, 786, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 786, __pyx_L1_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(3, 786, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 786, __pyx_L1_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(3, 786, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      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(3, 786, __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_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 786, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 786, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 786, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(3, 786, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(3, 786, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_py_key, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_py_value, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "pyarrow/types.pxi":787
 * 
 *     for py_key, py_value in metadata.items():
 *         key = tobytes(py_key)             # <<<<<<<<<<<<<<
 *         value = tobytes(py_value)
 *         meta.get().Append(key, value)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __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_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_v_py_key) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_py_key);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_10 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 787, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_key = __pyx_t_10;

    /* "pyarrow/types.pxi":788
 *     for py_key, py_value in metadata.items():
 *         key = tobytes(py_key)
 *         value = tobytes(py_value)             # <<<<<<<<<<<<<<
 *         meta.get().Append(key, value)
 *     out[0] = meta
 */
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __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_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_v_py_value) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_py_value);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_10 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 788, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_value = __pyx_t_10;

    /* "pyarrow/types.pxi":789
 *         key = tobytes(py_key)
 *         value = tobytes(py_value)
 *         meta.get().Append(key, value)             # <<<<<<<<<<<<<<
 *     out[0] = meta
 *     return 0
 */
    __pyx_v_meta.get()->Append(__pyx_v_key, __pyx_v_value);

    /* "pyarrow/types.pxi":786
 *         c_string key, value
 * 
 *     for py_key, py_value in metadata.items():             # <<<<<<<<<<<<<<
 *         key = tobytes(py_key)
 *         value = tobytes(py_value)
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":790
 *         value = tobytes(py_value)
 *         meta.get().Append(key, value)
 *     out[0] = meta             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
  (__pyx_v_out[0]) = __pyx_v_meta;

  /* "pyarrow/types.pxi":791
 *         meta.get().Append(key, value)
 *     out[0] = meta
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":779
 * # Type factory functions
 * 
 * cdef int convert_metadata(dict metadata,             # <<<<<<<<<<<<<<
 *                           shared_ptr[CKeyValueMetadata]* out) except -1:
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyarrow.lib.convert_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_py_key);
  __Pyx_XDECREF(__pyx_v_py_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":794
 * 
 * 
 * def field(name, type, bint nullable=True, dict metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Field instance
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_17field(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_16field[] = "field(name, type, bool nullable=True, dict 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_17field = {"field", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_17field, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_16field};
static PyObject *__pyx_pw_7pyarrow_3lib_17field(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_2,&__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_2)) != 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(3, 794, __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(3, 794, __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(3, 794, __pyx_L3_error)
    } else {
      __pyx_v_nullable = ((int)1);
    }
    __pyx_v_metadata = ((PyObject*)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(3, 794, __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:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metadata), (&PyDict_Type), 1, "metadata", 1))) __PYX_ERR(3, 794, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_16field(__pyx_self, __pyx_v_name, __pyx_v_type, __pyx_v_nullable, __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_16field(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name, PyObject *__pyx_v_type, int __pyx_v_nullable, PyObject *__pyx_v_metadata) {
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_v_c_meta;
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_result = 0;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v__type = 0;
  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;
  std::string __pyx_t_7;
  __Pyx_RefNannySetupContext("field", 0);

  /* "pyarrow/types.pxi":812
 *     cdef:
 *         shared_ptr[CKeyValueMetadata] c_meta
 *         Field result = Field.__new__(Field)             # <<<<<<<<<<<<<<
 *         DataType _type
 * 
 */
  __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(3, 812, __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":815
 *         DataType _type
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         convert_metadata(metadata, &c_meta)
 * 
 */
  __pyx_t_2 = (__pyx_v_metadata != ((PyObject*)Py_None));
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/types.pxi":816
 * 
 *     if metadata is not None:
 *         convert_metadata(metadata, &c_meta)             # <<<<<<<<<<<<<<
 * 
 *     _type = _as_type(type)
 */
    __pyx_t_4 = __pyx_f_7pyarrow_3lib_convert_metadata(__pyx_v_metadata, (&__pyx_v_c_meta)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 816, __pyx_L1_error)

    /* "pyarrow/types.pxi":815
 *         DataType _type
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         convert_metadata(metadata, &c_meta)
 * 
 */
  }

  /* "pyarrow/types.pxi":818
 *         convert_metadata(metadata, &c_meta)
 * 
 *     _type = _as_type(type)             # <<<<<<<<<<<<<<
 * 
 *     result.sp_field.reset(new CField(tobytes(name), _type.sp_type,
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__as_type(__pyx_v_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 818, __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(3, 818, __pyx_L1_error)
  __pyx_v__type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":820
 *     _type = _as_type(type)
 * 
 *     result.sp_field.reset(new CField(tobytes(name), _type.sp_type,             # <<<<<<<<<<<<<<
 *                                      nullable == 1, c_meta))
 *     result.field = result.sp_field.get()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 820, __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(3, 820, __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(3, 820, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":821
 * 
 *     result.sp_field.reset(new CField(tobytes(name), _type.sp_type,
 *                                      nullable == 1, c_meta))             # <<<<<<<<<<<<<<
 *     result.field = result.sp_field.get()
 *     result.type = _type
 */
  __pyx_v_result->sp_field.reset(new  arrow::Field(__pyx_t_7, __pyx_v__type->sp_type, (__pyx_v_nullable == 1), __pyx_v_c_meta));

  /* "pyarrow/types.pxi":822
 *     result.sp_field.reset(new CField(tobytes(name), _type.sp_type,
 *                                      nullable == 1, c_meta))
 *     result.field = result.sp_field.get()             # <<<<<<<<<<<<<<
 *     result.type = _type
 *     return result
 */
  __pyx_v_result->field = __pyx_v_result->sp_field.get();

  /* "pyarrow/types.pxi":823
 *                                      nullable == 1, c_meta))
 *     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":824
 *     result.field = result.sp_field.get()
 *     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":794
 * 
 * 
 * def field(name, type, bint nullable=True, dict 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":827
 * 
 * 
 * cdef _as_type(type):             # <<<<<<<<<<<<<<
 *     if isinstance(type, DataType):
 *         return type
 */

static PyObject *__pyx_f_7pyarrow_3lib__as_type(PyObject *__pyx_v_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;
  __Pyx_RefNannySetupContext("_as_type", 0);

  /* "pyarrow/types.pxi":828
 * 
 * cdef _as_type(type):
 *     if isinstance(type, DataType):             # <<<<<<<<<<<<<<
 *         return type
 *     if not isinstance(type, six.string_types):
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_type, __pyx_ptype_7pyarrow_3lib_DataType); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/types.pxi":829
 * cdef _as_type(type):
 *     if isinstance(type, DataType):
 *         return type             # <<<<<<<<<<<<<<
 *     if not isinstance(type, six.string_types):
 *         raise TypeError(type)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_type);
    __pyx_r = __pyx_v_type;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":828
 * 
 * cdef _as_type(type):
 *     if isinstance(type, DataType):             # <<<<<<<<<<<<<<
 *         return type
 *     if not isinstance(type, six.string_types):
 */
  }

  /* "pyarrow/types.pxi":830
 *     if isinstance(type, DataType):
 *         return type
 *     if not isinstance(type, six.string_types):             # <<<<<<<<<<<<<<
 *         raise TypeError(type)
 *     return type_for_alias(type)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_six); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 830, __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(3, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_type, __pyx_t_4); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(3, 830, __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":831
 *         return type
 *     if not isinstance(type, six.string_types):
 *         raise TypeError(type)             # <<<<<<<<<<<<<<
 *     return type_for_alias(type)
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_v_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 831, __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(3, 831, __pyx_L1_error)

    /* "pyarrow/types.pxi":830
 *     if isinstance(type, DataType):
 *         return type
 *     if not isinstance(type, six.string_types):             # <<<<<<<<<<<<<<
 *         raise TypeError(type)
 *     return type_for_alias(type)
 */
  }

  /* "pyarrow/types.pxi":832
 *     if not isinstance(type, six.string_types):
 *         raise TypeError(type)
 *     return type_for_alias(type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_type_for_alias); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 832, __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_type) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_type);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 832, __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/types.pxi":827
 * 
 * 
 * cdef _as_type(type):             # <<<<<<<<<<<<<<
 *     if isinstance(type, DataType):
 *         return type
 */

  /* 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_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":849
 * 
 * 
 * def null():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of null type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_19null(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18null[] = "null()\n\n    Create instance of null type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_19null = {"null", (PyCFunction)__pyx_pw_7pyarrow_3lib_19null, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18null};
static PyObject *__pyx_pw_7pyarrow_3lib_19null(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("null (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18null(__pyx_self);

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

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

  /* "pyarrow/types.pxi":853
 *     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(3, 853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":849
 * 
 * 
 * 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":856
 * 
 * 
 * def bool_():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of boolean type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_21bool_(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_20bool_[] = "bool_()\n\n    Create instance of boolean type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_21bool_ = {"bool_", (PyCFunction)__pyx_pw_7pyarrow_3lib_21bool_, METH_NOARGS, __pyx_doc_7pyarrow_3lib_20bool_};
static PyObject *__pyx_pw_7pyarrow_3lib_21bool_(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("bool_ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_20bool_(__pyx_self);

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

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

  /* "pyarrow/types.pxi":860
 *     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(3, 860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":856
 * 
 * 
 * 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":863
 * 
 * 
 * def uint8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned int8 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_23uint8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22uint8[] = "uint8()\n\n    Create instance of unsigned int8 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_23uint8 = {"uint8", (PyCFunction)__pyx_pw_7pyarrow_3lib_23uint8, METH_NOARGS, __pyx_doc_7pyarrow_3lib_22uint8};
static PyObject *__pyx_pw_7pyarrow_3lib_23uint8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uint8 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_22uint8(__pyx_self);

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

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

  /* "pyarrow/types.pxi":867
 *     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(3, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":863
 * 
 * 
 * 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":870
 * 
 * 
 * def int8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int8 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_25int8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_24int8[] = "int8()\n\n    Create instance of signed int8 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_25int8 = {"int8", (PyCFunction)__pyx_pw_7pyarrow_3lib_25int8, METH_NOARGS, __pyx_doc_7pyarrow_3lib_24int8};
static PyObject *__pyx_pw_7pyarrow_3lib_25int8(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("int8 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_24int8(__pyx_self);

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

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

  /* "pyarrow/types.pxi":874
 *     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(3, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":870
 * 
 * 
 * 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":877
 * 
 * 
 * def uint16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint16 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_27uint16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_26uint16[] = "uint16()\n\n    Create instance of unsigned uint16 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_27uint16 = {"uint16", (PyCFunction)__pyx_pw_7pyarrow_3lib_27uint16, METH_NOARGS, __pyx_doc_7pyarrow_3lib_26uint16};
static PyObject *__pyx_pw_7pyarrow_3lib_27uint16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uint16 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_26uint16(__pyx_self);

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

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

  /* "pyarrow/types.pxi":881
 *     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(3, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":877
 * 
 * 
 * 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":884
 * 
 * 
 * def int16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int16 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_29int16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_28int16[] = "int16()\n\n    Create instance of signed int16 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_29int16 = {"int16", (PyCFunction)__pyx_pw_7pyarrow_3lib_29int16, METH_NOARGS, __pyx_doc_7pyarrow_3lib_28int16};
static PyObject *__pyx_pw_7pyarrow_3lib_29int16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("int16 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_28int16(__pyx_self);

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

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

  /* "pyarrow/types.pxi":888
 *     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(3, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":884
 * 
 * 
 * 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":891
 * 
 * 
 * def uint32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint32 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_31uint32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_30uint32[] = "uint32()\n\n    Create instance of unsigned uint32 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_31uint32 = {"uint32", (PyCFunction)__pyx_pw_7pyarrow_3lib_31uint32, METH_NOARGS, __pyx_doc_7pyarrow_3lib_30uint32};
static PyObject *__pyx_pw_7pyarrow_3lib_31uint32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uint32 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_30uint32(__pyx_self);

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

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

  /* "pyarrow/types.pxi":895
 *     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(3, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":891
 * 
 * 
 * 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":898
 * 
 * 
 * def int32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int32 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_33int32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_32int32[] = "int32()\n\n    Create instance of signed int32 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_33int32 = {"int32", (PyCFunction)__pyx_pw_7pyarrow_3lib_33int32, METH_NOARGS, __pyx_doc_7pyarrow_3lib_32int32};
static PyObject *__pyx_pw_7pyarrow_3lib_33int32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("int32 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_32int32(__pyx_self);

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

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

  /* "pyarrow/types.pxi":902
 *     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(3, 902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":898
 * 
 * 
 * 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":905
 * 
 * 
 * def uint64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint64 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_35uint64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_34uint64[] = "uint64()\n\n    Create instance of unsigned uint64 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_35uint64 = {"uint64", (PyCFunction)__pyx_pw_7pyarrow_3lib_35uint64, METH_NOARGS, __pyx_doc_7pyarrow_3lib_34uint64};
static PyObject *__pyx_pw_7pyarrow_3lib_35uint64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uint64 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_34uint64(__pyx_self);

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

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

  /* "pyarrow/types.pxi":909
 *     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(3, 909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":905
 * 
 * 
 * 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":912
 * 
 * 
 * def int64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int64 type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_37int64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_36int64[] = "int64()\n\n    Create instance of signed int64 type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_37int64 = {"int64", (PyCFunction)__pyx_pw_7pyarrow_3lib_37int64, METH_NOARGS, __pyx_doc_7pyarrow_3lib_36int64};
static PyObject *__pyx_pw_7pyarrow_3lib_37int64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("int64 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_36int64(__pyx_self);

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

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

  /* "pyarrow/types.pxi":916
 *     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(3, 916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":912
 * 
 * 
 * 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":923
 * 
 * 
 * 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":924
 * 
 * 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":925
 * 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_s_s);
    __pyx_r = __pyx_n_s_s;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":924
 * 
 * cdef timeunit_to_string(TimeUnit unit):
 *     if unit == TimeUnit_SECOND:             # <<<<<<<<<<<<<<
 *         return 's'
 *     elif unit == TimeUnit_MILLI:
 */
    break;
    case  arrow::TimeUnit::MILLI:

    /* "pyarrow/types.pxi":927
 *         return 's'
 *     elif unit == TimeUnit_MILLI:
 *         return 'ms'             # <<<<<<<<<<<<<<
 *     elif unit == TimeUnit_MICRO:
 *         return 'us'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_s_ms);
    __pyx_r = __pyx_n_s_ms;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":926
 *     if unit == TimeUnit_SECOND:
 *         return 's'
 *     elif unit == TimeUnit_MILLI:             # <<<<<<<<<<<<<<
 *         return 'ms'
 *     elif unit == TimeUnit_MICRO:
 */
    break;
    case  arrow::TimeUnit::MICRO:

    /* "pyarrow/types.pxi":929
 *         return 'ms'
 *     elif unit == TimeUnit_MICRO:
 *         return 'us'             # <<<<<<<<<<<<<<
 *     elif unit == TimeUnit_NANO:
 *         return 'ns'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_s_us);
    __pyx_r = __pyx_n_s_us;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":928
 *     elif unit == TimeUnit_MILLI:
 *         return 'ms'
 *     elif unit == TimeUnit_MICRO:             # <<<<<<<<<<<<<<
 *         return 'us'
 *     elif unit == TimeUnit_NANO:
 */
    break;
    case  arrow::TimeUnit::NANO:

    /* "pyarrow/types.pxi":931
 *         return 'us'
 *     elif unit == TimeUnit_NANO:
 *         return 'ns'             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_s_ns);
    __pyx_r = __pyx_n_s_ns;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":930
 *     elif unit == TimeUnit_MICRO:
 *         return 'us'
 *     elif unit == TimeUnit_NANO:             # <<<<<<<<<<<<<<
 *         return 'ns'
 * 
 */
    break;
    default: break;
  }

  /* "pyarrow/types.pxi":923
 * 
 * 
 * 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":937
 * 
 * 
 * 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_39tzinfo_to_string(PyObject *__pyx_self, PyObject *__pyx_v_tz); /*proto*/
static char __pyx_doc_7pyarrow_3lib_38tzinfo_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_39tzinfo_to_string = {"tzinfo_to_string", (PyCFunction)__pyx_pw_7pyarrow_3lib_39tzinfo_to_string, METH_O, __pyx_doc_7pyarrow_3lib_38tzinfo_to_string};
static PyObject *__pyx_pw_7pyarrow_3lib_39tzinfo_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_38tzinfo_to_string(__pyx_self, ((PyObject *)__pyx_v_tz));

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

static PyObject *__pyx_pf_7pyarrow_3lib_38tzinfo_to_string(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tz) {
  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;
  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)(PyObject *);
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("tzinfo_to_string", 0);

  /* "pyarrow/types.pxi":955
 *         Time zone name
 *     """
 *     if tz.zone is None:             # <<<<<<<<<<<<<<
 *         sign = '+' if tz._minutes >= 0 else '-'
 *         hours, minutes = divmod(abs(tz._minutes), 60)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_zone); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 955, __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":956
 *     """
 *     if tz.zone is None:
 *         sign = '+' if tz._minutes >= 0 else '-'             # <<<<<<<<<<<<<<
 *         hours, minutes = divmod(abs(tz._minutes), 60)
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_minutes); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 956, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_int_0, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 956, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 956, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_3) {
      __Pyx_INCREF(__pyx_kp_s__12);
      __pyx_t_1 = __pyx_kp_s__12;
    } else {
      __Pyx_INCREF(__pyx_kp_s__13);
      __pyx_t_1 = __pyx_kp_s__13;
    }
    __pyx_v_sign = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":957
 *     if tz.zone is None:
 *         sign = '+' if tz._minutes >= 0 else '-'
 *         hours, minutes = divmod(abs(tz._minutes), 60)             # <<<<<<<<<<<<<<
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 *     else:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_minutes); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 957, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 957, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Divmod(__pyx_t_5, __pyx_int_60); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 957, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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(3, 957, __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_4 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_4);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(3, 957, __pyx_L1_error)
      __pyx_t_7 = NULL;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L5_unpacking_done;
      __pyx_L4_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(3, 957, __pyx_L1_error)
      __pyx_L5_unpacking_done:;
    }
    __pyx_v_hours = __pyx_t_5;
    __pyx_t_5 = 0;
    __pyx_v_minutes = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "pyarrow/types.pxi":958
 *         sign = '+' if tz._minutes >= 0 else '-'
 *         hours, minutes = divmod(abs(tz._minutes), 60)
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)             # <<<<<<<<<<<<<<
 *     else:
 *         return tz.zone
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_02d_02d, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 958, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_8 = 0;
    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_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_4)) {
      PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_v_sign, __pyx_v_hours, __pyx_v_minutes};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 958, __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[4] = {__pyx_t_5, __pyx_v_sign, __pyx_v_hours, __pyx_v_minutes};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 958, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_6 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 958, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_v_sign);
      __Pyx_GIVEREF(__pyx_v_sign);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_8, __pyx_v_sign);
      __Pyx_INCREF(__pyx_v_hours);
      __Pyx_GIVEREF(__pyx_v_hours);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_8, __pyx_v_hours);
      __Pyx_INCREF(__pyx_v_minutes);
      __Pyx_GIVEREF(__pyx_v_minutes);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_8, __pyx_v_minutes);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 958, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":955
 *         Time zone name
 *     """
 *     if tz.zone is None:             # <<<<<<<<<<<<<<
 *         sign = '+' if tz._minutes >= 0 else '-'
 *         hours, minutes = divmod(abs(tz._minutes), 60)
 */
  }

  /* "pyarrow/types.pxi":960
 *         return '{}{:02d}:{:02d}'.format(sign, hours, minutes)
 *     else:
 *         return tz.zone             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_tz, __pyx_n_s_zone); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 960, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/types.pxi":937
 * 
 * 
 * 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_5);
  __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_sign);
  __Pyx_XDECREF(__pyx_v_hours);
  __Pyx_XDECREF(__pyx_v_minutes);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":963
 * 
 * 
 * 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_41string_to_tzinfo(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_40string_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_41string_to_tzinfo = {"string_to_tzinfo", (PyCFunction)__pyx_pw_7pyarrow_3lib_41string_to_tzinfo, METH_O, __pyx_doc_7pyarrow_3lib_40string_to_tzinfo};
static PyObject *__pyx_pw_7pyarrow_3lib_41string_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_40string_to_tzinfo(__pyx_self, ((PyObject *)__pyx_v_name));

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

static PyObject *__pyx_pf_7pyarrow_3lib_40string_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":981
 *         Time zone object
 *     """
 *     import pytz             # <<<<<<<<<<<<<<
 *     m = _FIXED_OFFSET_RE.match(name)
 *     if m:
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pytz, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pytz = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":982
 *     """
 *     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(3, 982, __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(3, 982, __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(3, 982, __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":983
 *     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(3, 983, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/types.pxi":984
 *     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(3, 984, __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(3, 984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_kp_s__12, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 984, __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":985
 *     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(3, 985, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 985, __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(3, 985, __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(3, 985, __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(3, 985, __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(3, 985, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 985, __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(3, 985, __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(3, 985, __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(3, 985, __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":986
 *         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); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 986, __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(3, 986, __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(3, 986, __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(3, 986, __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(3, 986, __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":983
 *     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":988
 *         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(3, 988, __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(3, 988, __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":963
 * 
 * 
 * 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":991
 * 
 * 
 * def timestamp(unit, tz=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of timestamp type with resolution and optional time zone
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_43timestamp(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_42timestamp[] = "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_43timestamp = {"timestamp", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_43timestamp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_42timestamp};
static PyObject *__pyx_pw_7pyarrow_3lib_43timestamp(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(3, 991, __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(3, 991, __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_42timestamp(__pyx_self, __pyx_v_unit, __pyx_v_tz);

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

static PyObject *__pyx_pf_7pyarrow_3lib_42timestamp(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":1018
 *         c_string c_timezone
 * 
 *     if unit == "s":             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_s, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1018, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1019
 * 
 *     if unit == "s":
 *         unit_code = TimeUnit_SECOND             # <<<<<<<<<<<<<<
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI
 */
    __pyx_v_unit_code =  arrow::TimeUnit::SECOND;

    /* "pyarrow/types.pxi":1018
 *         c_string c_timezone
 * 
 *     if unit == "s":             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1020
 *     if unit == "s":
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_ms, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1020, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1021
 *         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":1020
 *     if unit == "s":
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1022
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_us, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1022, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1023
 *         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":1022
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI
 *     elif unit == 'us':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1024
 *     elif unit == 'us':
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_NANO
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_ns, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1024, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "pyarrow/types.pxi":1025
 *         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":1024
 *     elif unit == 'us':
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_NANO
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1027
 *         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__15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 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(3, 1027, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1029
 *         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(3, 1029, __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":1031
 *     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":1032
 * 
 *     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));

    /* "pyarrow/types.pxi":1033
 *     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(3, 1033, __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(3, 1033, __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(3, 1033, __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":1034
 *         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(3, 1034, __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(3, 1034, __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(3, 1034, __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":1033
 *     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":1035
 *         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(3, 1035, __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(3, 1035, __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(3, 1035, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/types.pxi":1031
 *     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":1037
 *         _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(3, 1037, __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(3, 1037, __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(3, 1037, __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":1038
 *     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(3, 1038, __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(3, 1038, __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":1037
 *         _timestamp_type_cache[unit_code] = out
 *     else:
 *         if not isinstance(tz, six.string_types):             # <<<<<<<<<<<<<<
 *             tz = tzinfo_to_string(tz)
 * 
 */
    }

    /* "pyarrow/types.pxi":1040
 *             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(3, 1040, __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(3, 1040, __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(3, 1040, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_c_timezone = __pyx_t_6;

    /* "pyarrow/types.pxi":1041
 * 
 *         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));
  }
  __pyx_L4:;

  /* "pyarrow/types.pxi":1043
 *         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":991
 * 
 * 
 * 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":1046
 * 
 * 
 * def time32(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit time (time of day) type with unit resolution
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_45time32(PyObject *__pyx_self, PyObject *__pyx_v_unit); /*proto*/
static char __pyx_doc_7pyarrow_3lib_44time32[] = "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_45time32 = {"time32", (PyCFunction)__pyx_pw_7pyarrow_3lib_45time32, METH_O, __pyx_doc_7pyarrow_3lib_44time32};
static PyObject *__pyx_pw_7pyarrow_3lib_45time32(PyObject *__pyx_self, PyObject *__pyx_v_unit) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("time32 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_44time32(__pyx_self, ((PyObject *)__pyx_v_unit));

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

static PyObject *__pyx_pf_7pyarrow_3lib_44time32(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":1066
 *         c_string c_timezone
 * 
 *     if unit == 's':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_s, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1066, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1067
 * 
 *     if unit == 's':
 *         unit_code = TimeUnit_SECOND             # <<<<<<<<<<<<<<
 *     elif unit == 'ms':
 *         unit_code = TimeUnit_MILLI
 */
    __pyx_v_unit_code =  arrow::TimeUnit::SECOND;

    /* "pyarrow/types.pxi":1066
 *         c_string c_timezone
 * 
 *     if unit == 's':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1068
 *     if unit == 's':
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MILLI
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_ms, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1068, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "pyarrow/types.pxi":1069
 *         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":1068
 *     if unit == 's':
 *         unit_code = TimeUnit_SECOND
 *     elif unit == 'ms':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MILLI
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1071
 *         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_s_Invalid_TimeUnit_for_time32, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1071, __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(3, 1071, __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(3, 1071, __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(3, 1071, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1073
 *         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(3, 1073, __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(3, 1073, __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(3, 1073, __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":1074
 * 
 *     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(3, 1074, __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(3, 1074, __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(3, 1074, __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":1073
 *         raise ValueError('Invalid TimeUnit for time32: {}'.format(unit))
 * 
 *     if unit_code in _time_type_cache:             # <<<<<<<<<<<<<<
 *         return _time_type_cache[unit_code]
 * 
 */
  }

  /* "pyarrow/types.pxi":1076
 *         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(3, 1076, __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":1078
 *     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));

  /* "pyarrow/types.pxi":1079
 * 
 *     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(3, 1079, __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(3, 1079, __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(3, 1079, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1081
 *     _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":1046
 * 
 * 
 * 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":1084
 * 
 * 
 * def time64(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit time (time of day) type with unit resolution
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_47time64(PyObject *__pyx_self, PyObject *__pyx_v_unit); /*proto*/
static char __pyx_doc_7pyarrow_3lib_46time64[] = "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_47time64 = {"time64", (PyCFunction)__pyx_pw_7pyarrow_3lib_47time64, METH_O, __pyx_doc_7pyarrow_3lib_46time64};
static PyObject *__pyx_pw_7pyarrow_3lib_47time64(PyObject *__pyx_self, PyObject *__pyx_v_unit) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("time64 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_46time64(__pyx_self, ((PyObject *)__pyx_v_unit));

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

static PyObject *__pyx_pf_7pyarrow_3lib_46time64(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":1104
 *         c_string c_timezone
 * 
 *     if unit == 'us':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_us, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1104, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1105
 * 
 *     if unit == 'us':
 *         unit_code = TimeUnit_MICRO             # <<<<<<<<<<<<<<
 *     elif unit == 'ns':
 *         unit_code = TimeUnit_NANO
 */
    __pyx_v_unit_code =  arrow::TimeUnit::MICRO;

    /* "pyarrow/types.pxi":1104
 *         c_string c_timezone
 * 
 *     if unit == 'us':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1106
 *     if unit == 'us':
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_NANO
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_unit, __pyx_n_s_ns, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1106, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "pyarrow/types.pxi":1107
 *         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":1106
 *     if unit == 'us':
 *         unit_code = TimeUnit_MICRO
 *     elif unit == 'ns':             # <<<<<<<<<<<<<<
 *         unit_code = TimeUnit_NANO
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1109
 *         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_s_Invalid_TimeUnit_for_time64, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1109, __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(3, 1109, __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(3, 1109, __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(3, 1109, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1111
 *         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(3, 1111, __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(3, 1111, __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(3, 1111, __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":1112
 * 
 *     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(3, 1112, __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(3, 1112, __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(3, 1112, __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":1111
 *         raise ValueError('Invalid TimeUnit for time64: {}'.format(unit))
 * 
 *     if unit_code in _time_type_cache:             # <<<<<<<<<<<<<<
 *         return _time_type_cache[unit_code]
 * 
 */
  }

  /* "pyarrow/types.pxi":1114
 *         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(3, 1114, __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":1116
 *     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));

  /* "pyarrow/types.pxi":1117
 * 
 *     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(3, 1117, __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(3, 1117, __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(3, 1117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":1119
 *     _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":1084
 * 
 * 
 * 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":1122
 * 
 * 
 * def date32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit date (days since UNIX epoch 1970-01-01)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_49date32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_48date32[] = "date32()\n\n    Create instance of 32-bit date (days since UNIX epoch 1970-01-01)\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_49date32 = {"date32", (PyCFunction)__pyx_pw_7pyarrow_3lib_49date32, METH_NOARGS, __pyx_doc_7pyarrow_3lib_48date32};
static PyObject *__pyx_pw_7pyarrow_3lib_49date32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("date32 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_48date32(__pyx_self);

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

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

  /* "pyarrow/types.pxi":1126
 *     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(3, 1126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1122
 * 
 * 
 * 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":1129
 * 
 * 
 * def date64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_51date64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_50date64[] = "date64()\n\n    Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_51date64 = {"date64", (PyCFunction)__pyx_pw_7pyarrow_3lib_51date64, METH_NOARGS, __pyx_doc_7pyarrow_3lib_50date64};
static PyObject *__pyx_pw_7pyarrow_3lib_51date64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("date64 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_50date64(__pyx_self);

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

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

  /* "pyarrow/types.pxi":1133
 *     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(3, 1133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1129
 * 
 * 
 * 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":1136
 * 
 * 
 * def float16():             # <<<<<<<<<<<<<<
 *     """
 *     Create half-precision floating point type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_53float16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_52float16[] = "float16()\n\n    Create half-precision floating point type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_53float16 = {"float16", (PyCFunction)__pyx_pw_7pyarrow_3lib_53float16, METH_NOARGS, __pyx_doc_7pyarrow_3lib_52float16};
static PyObject *__pyx_pw_7pyarrow_3lib_53float16(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("float16 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_52float16(__pyx_self);

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

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

  /* "pyarrow/types.pxi":1140
 *     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(3, 1140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1136
 * 
 * 
 * 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":1143
 * 
 * 
 * def float32():             # <<<<<<<<<<<<<<
 *     """
 *     Create single-precision floating point type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_55float32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_54float32[] = "float32()\n\n    Create single-precision floating point type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_55float32 = {"float32", (PyCFunction)__pyx_pw_7pyarrow_3lib_55float32, METH_NOARGS, __pyx_doc_7pyarrow_3lib_54float32};
static PyObject *__pyx_pw_7pyarrow_3lib_55float32(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("float32 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_54float32(__pyx_self);

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

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

  /* "pyarrow/types.pxi":1147
 *     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(3, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1143
 * 
 * 
 * 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":1150
 * 
 * 
 * def float64():             # <<<<<<<<<<<<<<
 *     """
 *     Create double-precision floating point type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_57float64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_56float64[] = "float64()\n\n    Create double-precision floating point type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_57float64 = {"float64", (PyCFunction)__pyx_pw_7pyarrow_3lib_57float64, METH_NOARGS, __pyx_doc_7pyarrow_3lib_56float64};
static PyObject *__pyx_pw_7pyarrow_3lib_57float64(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("float64 (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_56float64(__pyx_self);

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

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

  /* "pyarrow/types.pxi":1154
 *     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(3, 1154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1150
 * 
 * 
 * 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":1157
 * 
 * 
 * cpdef DataType decimal128(int precision, int scale=0):             # <<<<<<<<<<<<<<
 *     """
 *     Create decimal type with precision and scale and 128bit width
 */

static PyObject *__pyx_pw_7pyarrow_3lib_59decimal128(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
  PyObject *__pyx_t_1 = 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":1171
 *     """
 *     cdef shared_ptr[CDataType] decimal_type
 *     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":1172
 *     cdef shared_ptr[CDataType] decimal_type
 *     decimal_type.reset(new CDecimal128Type(precision, scale))
 *     return pyarrow_wrap_data_type(decimal_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_decimal_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1172, __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(3, 1172, __pyx_L1_error)
  __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1157
 * 
 * 
 * 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_1);
  __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_59decimal128(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_58decimal128[] = "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_59decimal128(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(3, 1157, __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(3, 1157, __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(3, 1157, __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(3, 1157, __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_58decimal128(__pyx_self, __pyx_v_precision, __pyx_v_scale);

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

static PyObject *__pyx_pf_7pyarrow_3lib_58decimal128(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(3, 1157, __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":1175
 * 
 * 
 * def string():             # <<<<<<<<<<<<<<
 *     """
 *     Create UTF8 variable-length string type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_61string(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_60string[] = "string()\n\n    Create UTF8 variable-length string type\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_61string = {"string", (PyCFunction)__pyx_pw_7pyarrow_3lib_61string, METH_NOARGS, __pyx_doc_7pyarrow_3lib_60string};
static PyObject *__pyx_pw_7pyarrow_3lib_61string(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("string (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_60string(__pyx_self);

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

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

  /* "pyarrow/types.pxi":1179
 *     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(3, 1179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1175
 * 
 * 
 * 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":1182
 * 
 * 
 * def binary(int length=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create variable-length binary type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_63binary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_62binary[] = "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_63binary = {"binary", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_63binary, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_62binary};
static PyObject *__pyx_pw_7pyarrow_3lib_63binary(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(3, 1182, __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(3, 1182, __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(3, 1182, __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_62binary(__pyx_self, __pyx_v_length);

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

static PyObject *__pyx_pf_7pyarrow_3lib_62binary(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":1193
 *         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":1194
 *     """
 *     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(3, 1194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/types.pxi":1193
 *         width `length`.
 *     """
 *     if length == -1:             # <<<<<<<<<<<<<<
 *         return primitive_type(_Type_BINARY)
 * 
 */
  }

  /* "pyarrow/types.pxi":1197
 * 
 *     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":1198
 *     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(3, 1198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1182
 * 
 * 
 * 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":1201
 * 
 * 
 * cpdef ListType list_(value_type):             # <<<<<<<<<<<<<<
 *     """
 *     Create ListType instance from child data type or field
 */

static PyObject *__pyx_pw_7pyarrow_3lib_65list_(PyObject *__pyx_self, PyObject *__pyx_v_value_type); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_f_7pyarrow_3lib_list_(PyObject *__pyx_v_value_type, CYTHON_UNUSED int __pyx_skip_dispatch) {
  std::shared_ptr< arrow::DataType>  __pyx_v_list_type;
  struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_v_out = 0;
  struct __pyx_obj_7pyarrow_3lib_ListType *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("list_", 0);

  /* "pyarrow/types.pxi":1217
 *         Field field
 *         shared_ptr[CDataType] list_type
 *         ListType out = ListType.__new__(ListType)             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(value_type, DataType):
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_ListType(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_ListType), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1217, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_ListType *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":1219
 *         ListType out = ListType.__new__(ListType)
 * 
 *     if isinstance(value_type, DataType):             # <<<<<<<<<<<<<<
 *         list_type.reset(new CListType((<DataType> value_type).sp_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":1220
 * 
 *     if isinstance(value_type, DataType):
 *         list_type.reset(new CListType((<DataType> value_type).sp_type))             # <<<<<<<<<<<<<<
 *     elif isinstance(value_type, Field):
 *         list_type.reset(new CListType((<Field> value_type).sp_field))
 */
    __pyx_v_list_type.reset(new  arrow::ListType(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_value_type)->sp_type));

    /* "pyarrow/types.pxi":1219
 *         ListType out = ListType.__new__(ListType)
 * 
 *     if isinstance(value_type, DataType):             # <<<<<<<<<<<<<<
 *         list_type.reset(new CListType((<DataType> value_type).sp_type))
 *     elif isinstance(value_type, Field):
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1221
 *     if isinstance(value_type, DataType):
 *         list_type.reset(new CListType((<DataType> value_type).sp_type))
 *     elif isinstance(value_type, Field):             # <<<<<<<<<<<<<<
 *         list_type.reset(new CListType((<Field> value_type).sp_field))
 *     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":1222
 *         list_type.reset(new CListType((<DataType> value_type).sp_type))
 *     elif isinstance(value_type, Field):
 *         list_type.reset(new CListType((<Field> value_type).sp_field))             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError('List requires DataType or Field')
 */
    __pyx_v_list_type.reset(new  arrow::ListType(((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_v_value_type)->sp_field));

    /* "pyarrow/types.pxi":1221
 *     if isinstance(value_type, DataType):
 *         list_type.reset(new CListType((<DataType> value_type).sp_type))
 *     elif isinstance(value_type, Field):             # <<<<<<<<<<<<<<
 *         list_type.reset(new CListType((<Field> value_type).sp_field))
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/types.pxi":1224
 *         list_type.reset(new CListType((<Field> value_type).sp_field))
 *     else:
 *         raise ValueError('List requires DataType or Field')             # <<<<<<<<<<<<<<
 * 
 *     out.init(list_type)
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1224, __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(3, 1224, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1226
 *         raise ValueError('List requires DataType or Field')
 * 
 *     out.init(list_type)             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_ListType *)__pyx_v_out->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_out), __pyx_v_list_type);

  /* "pyarrow/types.pxi":1227
 * 
 *     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":1201
 * 
 * 
 * cpdef ListType list_(value_type):             # <<<<<<<<<<<<<<
 *     """
 *     Create ListType instance from child data type or field
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.list_", __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;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_65list_(PyObject *__pyx_self, PyObject *__pyx_v_value_type); /*proto*/
static char __pyx_doc_7pyarrow_3lib_64list_[] = "list_(value_type) -> ListType\n\n    Create ListType instance from child data type or field\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_65list_(PyObject *__pyx_self, PyObject *__pyx_v_value_type) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("list_ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_64list_(__pyx_self, ((PyObject *)__pyx_v_value_type));

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

static PyObject *__pyx_pf_7pyarrow_3lib_64list_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_value_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("list_", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib_list_(__pyx_v_value_type, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1201, __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.list_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1230
 * 
 * 
 * cpdef DictionaryType dictionary(DataType index_type, Array dict_values,             # <<<<<<<<<<<<<<
 *                                 bint ordered=False):
 *     """
 */

static PyObject *__pyx_pw_7pyarrow_3lib_67dictionary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_7pyarrow_3lib_DictionaryType *__pyx_f_7pyarrow_3lib_dictionary(struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_index_type, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_dict_values, CYTHON_UNUSED int __pyx_skip_dispatch, struct __pyx_opt_args_7pyarrow_3lib_dictionary *__pyx_optional_args) {

  /* "pyarrow/types.pxi":1231
 * 
 * cpdef DictionaryType dictionary(DataType index_type, Array dict_values,
 *                                 bint ordered=False):             # <<<<<<<<<<<<<<
 *     """
 *     Dictionary (categorical, or simply encoded) type
 */
  int __pyx_v_ordered = ((int)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;
  __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":1245
 *     type : DictionaryType
 *     """
 *     cdef DictionaryType out = DictionaryType.__new__(DictionaryType)             # <<<<<<<<<<<<<<
 *     cdef shared_ptr[CDataType] dict_type
 *     dict_type.reset(new CDictionaryType(index_type.sp_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(3, 1245, __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":1247
 *     cdef DictionaryType out = DictionaryType.__new__(DictionaryType)
 *     cdef shared_ptr[CDataType] dict_type
 *     dict_type.reset(new CDictionaryType(index_type.sp_type,             # <<<<<<<<<<<<<<
 *                                         dict_values.sp_array,
 *                                         ordered == 1))
 */
  __pyx_v_dict_type.reset(new  arrow::DictionaryType(__pyx_v_index_type->sp_type, __pyx_v_dict_values->sp_array, (__pyx_v_ordered == 1)));

  /* "pyarrow/types.pxi":1250
 *                                         dict_values.sp_array,
 *                                         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);

  /* "pyarrow/types.pxi":1251
 *                                         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":1230
 * 
 * 
 * cpdef DictionaryType dictionary(DataType index_type, Array dict_values,             # <<<<<<<<<<<<<<
 *                                 bint ordered=False):
 *     """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.dictionary", __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;
}

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_67dictionary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_66dictionary[] = "dictionary(DataType index_type, Array dict_values, bool ordered=False) -> DictionaryType\n\n    Dictionary (categorical, or simply encoded) type\n\n    Parameters\n    ----------\n    index_type : DataType\n    dictionary : Array\n    ordered : boolean\n\n    Returns\n    -------\n    type : DictionaryType\n    ";
static PyObject *__pyx_pw_7pyarrow_3lib_67dictionary(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_index_type = 0;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_dict_values = 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_dict_values,&__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_dict_values)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("dictionary", 0, 2, 3, 1); __PYX_ERR(3, 1230, __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(3, 1230, __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 = ((struct __pyx_obj_7pyarrow_3lib_DataType *)values[0]);
    __pyx_v_dict_values = ((struct __pyx_obj_7pyarrow_3lib_Array *)values[1]);
    if (values[2]) {
      __pyx_v_ordered = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_ordered == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1231, __pyx_L3_error)
    } else {

      /* "pyarrow/types.pxi":1231
 * 
 * cpdef DictionaryType dictionary(DataType index_type, Array dict_values,
 *                                 bint ordered=False):             # <<<<<<<<<<<<<<
 *     """
 *     Dictionary (categorical, or simply encoded) type
 */
      __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(3, 1230, __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:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index_type), __pyx_ptype_7pyarrow_3lib_DataType, 1, "index_type", 0))) __PYX_ERR(3, 1230, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dict_values), __pyx_ptype_7pyarrow_3lib_Array, 1, "dict_values", 0))) __PYX_ERR(3, 1230, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_66dictionary(__pyx_self, __pyx_v_index_type, __pyx_v_dict_values, __pyx_v_ordered);

  /* "pyarrow/types.pxi":1230
 * 
 * 
 * cpdef DictionaryType dictionary(DataType index_type, Array dict_values,             # <<<<<<<<<<<<<<
 *                                 bint ordered=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_66dictionary(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_index_type, struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_dict_values, 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_dict_values, 0, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1230, __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":1254
 * 
 * 
 * def struct(fields):             # <<<<<<<<<<<<<<
 *     """
 *     Create StructType instance from fields
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_69struct(PyObject *__pyx_self, PyObject *__pyx_v_fields); /*proto*/
static char __pyx_doc_7pyarrow_3lib_68struct[] = "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_69struct = {"struct", (PyCFunction)__pyx_pw_7pyarrow_3lib_69struct, METH_O, __pyx_doc_7pyarrow_3lib_68struct};
static PyObject *__pyx_pw_7pyarrow_3lib_69struct(PyObject *__pyx_self, PyObject *__pyx_v_fields) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("struct (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_68struct(__pyx_self, ((PyObject *)__pyx_v_fields));

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

static PyObject *__pyx_pf_7pyarrow_3lib_68struct(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":1288
 *         cdef shared_ptr[CDataType] struct_type
 * 
 *     if isinstance(fields, collections.Mapping):             # <<<<<<<<<<<<<<
 *         fields = fields.items()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_collections); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1288, __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(3, 1288, __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(3, 1288, __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":1289
 * 
 *     if isinstance(fields, collections.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(3, 1289, __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(3, 1289, __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":1288
 *         cdef shared_ptr[CDataType] struct_type
 * 
 *     if isinstance(fields, collections.Mapping):             # <<<<<<<<<<<<<<
 *         fields = fields.items()
 * 
 */
  }

  /* "pyarrow/types.pxi":1291
 *         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(3, 1291, __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(3, 1291, __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(3, 1291, __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(3, 1291, __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(3, 1291, __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(3, 1291, __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(3, 1291, __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":1292
 * 
 *     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":1293
 *     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(3, 1293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_item); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1293, __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(3, 1293, __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(3, 1293, __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":1292
 * 
 *     for item in fields:
 *         if isinstance(item, tuple):             # <<<<<<<<<<<<<<
 *             py_field = field(*item)
 *         else:
 */
      goto __pyx_L6;
    }

    /* "pyarrow/types.pxi":1295
 *             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(3, 1295, __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":1296
 *         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(3, 1296, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":1291
 *         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":1298
 *         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":1299
 * 
 *     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(3, 1299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1254
 * 
 * 
 * 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":1302
 * 
 * 
 * def union(children_fields, mode):             # <<<<<<<<<<<<<<
 *     """
 *     Create UnionType from children fields.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_71union(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_70union[] = "union(children_fields, mode)\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\n    Returns\n    -------\n    type : DataType\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_71union = {"union", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_71union, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_70union};
static PyObject *__pyx_pw_7pyarrow_3lib_71union(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_children_fields = 0;
  PyObject *__pyx_v_mode = 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,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_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", 1, 2, 2, 1); __PYX_ERR(3, 1302, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "union") < 0)) __PYX_ERR(3, 1302, __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_children_fields = values[0];
    __pyx_v_mode = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("union", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1302, __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_70union(__pyx_self, __pyx_v_children_fields, __pyx_v_mode);

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

static PyObject *__pyx_pf_7pyarrow_3lib_70union(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_children_fields, PyObject *__pyx_v_mode) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_child_field = 0;
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_c_fields;
  std::vector<uint8_t>  __pyx_v_type_codes;
  std::shared_ptr< arrow::DataType>  __pyx_v_union_type;
  int __pyx_v_i;
  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;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  __Pyx_RefNannySetupContext("union", 0);
  __Pyx_INCREF(__pyx_v_mode);

  /* "pyarrow/types.pxi":1323
 *         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":1324
 * 
 *     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(3, 1324, __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(3, 1324, __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(3, 1324, __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(3, 1324, __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(3, 1324, __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(3, 1324, __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":1325
 *     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_s_Invalid_union_mode_0_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1325, __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(3, 1325, __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(3, 1325, __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(3, 1325, __pyx_L1_error)

      /* "pyarrow/types.pxi":1324
 * 
 *     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":1323
 *         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":1327
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 *     else:
 *         if mode == 'sparse':             # <<<<<<<<<<<<<<
 *             mode = _UnionMode_SPARSE
 *         elif mode == 'dense':
 */
  /*else*/ {
    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_sparse, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1327, __pyx_L1_error)
    if (__pyx_t_1) {

      /* "pyarrow/types.pxi":1328
 *     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(3, 1328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/types.pxi":1327
 *             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":1329
 *         if mode == 'sparse':
 *             mode = _UnionMode_SPARSE
 *         elif mode == 'dense':             # <<<<<<<<<<<<<<
 *             mode = _UnionMode_DENSE
 *         else:
 */
    __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_dense, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1329, __pyx_L1_error)
    if (likely(__pyx_t_1)) {

      /* "pyarrow/types.pxi":1330
 *             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(3, 1330, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "pyarrow/types.pxi":1329
 *         if mode == 'sparse':
 *             mode = _UnionMode_SPARSE
 *         elif mode == 'dense':             # <<<<<<<<<<<<<<
 *             mode = _UnionMode_DENSE
 *         else:
 */
      goto __pyx_L7;
    }

    /* "pyarrow/types.pxi":1332
 *             mode = _UnionMode_DENSE
 *         else:
 *             raise ValueError("Invalid union mode {0!r}".format(mode))             # <<<<<<<<<<<<<<
 * 
 *     for i, child_field in enumerate(children_fields):
 */
    /*else*/ {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Invalid_union_mode_0_r, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1332, __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(3, 1332, __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(3, 1332, __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(3, 1332, __pyx_L1_error)
    }
    __pyx_L7:;
  }
  __pyx_L3:;

  /* "pyarrow/types.pxi":1334
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 * 
 *     for i, child_field in enumerate(children_fields):             # <<<<<<<<<<<<<<
 *         type_codes.push_back(i)
 *         c_fields.push_back(child_field.sp_field)
 */
  __pyx_t_6 = 0;
  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_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_children_fields); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1334, __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(3, 1334, __pyx_L1_error)
  }
  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(3, 1334, __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(3, 1334, __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(3, 1334, __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(3, 1334, __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(3, 1334, __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(3, 1334, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_child_field, ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_v_i = __pyx_t_6;
    __pyx_t_6 = (__pyx_t_6 + 1);

    /* "pyarrow/types.pxi":1335
 * 
 *     for i, child_field in enumerate(children_fields):
 *         type_codes.push_back(i)             # <<<<<<<<<<<<<<
 *         c_fields.push_back(child_field.sp_field)
 * 
 */
    try {
      __pyx_v_type_codes.push_back(__pyx_v_i);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(3, 1335, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":1336
 *     for i, child_field in enumerate(children_fields):
 *         type_codes.push_back(i)
 *         c_fields.push_back(child_field.sp_field)             # <<<<<<<<<<<<<<
 * 
 *     if mode == UnionMode_SPARSE:
 */
    try {
      __pyx_v_c_fields.push_back(__pyx_v_child_field->sp_field);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(3, 1336, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":1334
 *             raise ValueError("Invalid union mode {0!r}".format(mode))
 * 
 *     for i, child_field in enumerate(children_fields):             # <<<<<<<<<<<<<<
 *         type_codes.push_back(i)
 *         c_fields.push_back(child_field.sp_field)
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/types.pxi":1338
 *         c_fields.push_back(child_field.sp_field)
 * 
 *     if mode == UnionMode_SPARSE:             # <<<<<<<<<<<<<<
 *         union_type.reset(new CUnionType(c_fields, type_codes,
 *                                         _UnionMode_SPARSE))
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_UnionMode_SPARSE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_v_mode, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 1338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_1) {

    /* "pyarrow/types.pxi":1339
 * 
 *     if mode == UnionMode_SPARSE:
 *         union_type.reset(new CUnionType(c_fields, type_codes,             # <<<<<<<<<<<<<<
 *                                         _UnionMode_SPARSE))
 *     else:
 */
    __pyx_v_union_type.reset(new  arrow::UnionType(__pyx_v_c_fields, __pyx_v_type_codes,  arrow::UnionMode::SPARSE));

    /* "pyarrow/types.pxi":1338
 *         c_fields.push_back(child_field.sp_field)
 * 
 *     if mode == UnionMode_SPARSE:             # <<<<<<<<<<<<<<
 *         union_type.reset(new CUnionType(c_fields, type_codes,
 *                                         _UnionMode_SPARSE))
 */
    goto __pyx_L10;
  }

  /* "pyarrow/types.pxi":1342
 *                                         _UnionMode_SPARSE))
 *     else:
 *         union_type.reset(new CUnionType(c_fields, type_codes,             # <<<<<<<<<<<<<<
 *                                         _UnionMode_DENSE))
 * 
 */
  /*else*/ {

    /* "pyarrow/types.pxi":1343
 *     else:
 *         union_type.reset(new CUnionType(c_fields, 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_type_codes,  arrow::UnionMode::DENSE));
  }
  __pyx_L10:;

  /* "pyarrow/types.pxi":1345
 *                                         _UnionMode_DENSE))
 * 
 *     return pyarrow_wrap_data_type(union_type)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_union_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1302
 * 
 * 
 * def union(children_fields, mode):             # <<<<<<<<<<<<<<
 *     """
 *     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_mode);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/types.pxi":1395
 * 
 * 
 * def type_for_alias(name):             # <<<<<<<<<<<<<<
 *     """
 *     Return DataType given a string alias if one exists
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_73type_for_alias(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7pyarrow_3lib_72type_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_73type_for_alias = {"type_for_alias", (PyCFunction)__pyx_pw_7pyarrow_3lib_73type_for_alias, METH_O, __pyx_doc_7pyarrow_3lib_72type_for_alias};
static PyObject *__pyx_pw_7pyarrow_3lib_73type_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_72type_for_alias(__pyx_self, ((PyObject *)__pyx_v_name));

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

static PyObject *__pyx_pf_7pyarrow_3lib_72type_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":1403
 *     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(3, 1403, __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(3, 1403, __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":1404
 *     """
 *     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":1405
 *     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(3, 1405, __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(3, 1405, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_alias = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "pyarrow/types.pxi":1404
 *     """
 *     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_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/types.pxi":1406
 *     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(3, 1406, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);

      /* "pyarrow/types.pxi":1407
 *         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_s_No_type_alias_for_0, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 1407, __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(3, 1407, __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(3, 1407, __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(3, 1407, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/types.pxi":1404
 *     """
 *     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":1409
 *         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":1410
 * 
 *     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":1409
 *         raise ValueError('No type alias for {0}'.format(name))
 * 
 *     if isinstance(alias, DataType):             # <<<<<<<<<<<<<<
 *         return alias
 *     return alias()
 */
  }

  /* "pyarrow/types.pxi":1411
 *     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(3, 1411, __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":1395
 * 
 * 
 * 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":1414
 * 
 * 
 * def schema(fields, dict metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct pyarrow.Schema from collection of fields
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_75schema(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_74schema[] = "schema(fields, dict 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_75schema = {"schema", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_75schema, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_74schema};
static PyObject *__pyx_pw_7pyarrow_3lib_75schema(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(3, 1414, __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 = ((PyObject*)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(3, 1414, __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:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metadata), (&PyDict_Type), 1, "metadata", 1))) __PYX_ERR(3, 1414, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_74schema(__pyx_self, __pyx_v_fields, __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_74schema(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;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("schema", 0);
  __Pyx_INCREF(__pyx_v_fields);

  /* "pyarrow/types.pxi":1446
 *         vector[shared_ptr[CField]] c_fields
 * 
 *     if isinstance(fields, collections.Mapping):             # <<<<<<<<<<<<<<
 *         fields = fields.items()
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_collections); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1446, __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(3, 1446, __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(3, 1446, __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":1447
 * 
 *     if isinstance(fields, collections.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(3, 1447, __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(3, 1447, __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":1446
 *         vector[shared_ptr[CField]] c_fields
 * 
 *     if isinstance(fields, collections.Mapping):             # <<<<<<<<<<<<<<
 *         fields = fields.items()
 * 
 */
  }

  /* "pyarrow/types.pxi":1449
 *         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(3, 1449, __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(3, 1449, __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(3, 1449, __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(3, 1449, __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(3, 1449, __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(3, 1449, __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(3, 1449, __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":1450
 * 
 *     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":1451
 *     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(3, 1451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_item); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1451, __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(3, 1451, __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(3, 1451, __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":1450
 * 
 *     for item in fields:
 *         if isinstance(item, tuple):             # <<<<<<<<<<<<<<
 *             py_field = field(*item)
 *         else:
 */
      goto __pyx_L6;
    }

    /* "pyarrow/types.pxi":1453
 *             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(3, 1453, __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":1454
 *         else:
 *             py_field = item
 *         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(3, 1454, __pyx_L1_error)
    }

    /* "pyarrow/types.pxi":1449
 *         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":1456
 *         c_fields.push_back(py_field.sp_field)
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         convert_metadata(metadata, &c_meta)
 * 
 */
  __pyx_t_3 = (__pyx_v_metadata != ((PyObject*)Py_None));
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/types.pxi":1457
 * 
 *     if metadata is not None:
 *         convert_metadata(metadata, &c_meta)             # <<<<<<<<<<<<<<
 * 
 *     c_schema.reset(new CSchema(c_fields, c_meta))
 */
    __pyx_t_9 = __pyx_f_7pyarrow_3lib_convert_metadata(__pyx_v_metadata, (&__pyx_v_c_meta)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 1457, __pyx_L1_error)

    /* "pyarrow/types.pxi":1456
 *         c_fields.push_back(py_field.sp_field)
 * 
 *     if metadata is not None:             # <<<<<<<<<<<<<<
 *         convert_metadata(metadata, &c_meta)
 * 
 */
  }

  /* "pyarrow/types.pxi":1459
 *         convert_metadata(metadata, &c_meta)
 * 
 *     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":1460
 * 
 *     c_schema.reset(new CSchema(c_fields, c_meta))
 *     result = Schema.__new__(Schema)             # <<<<<<<<<<<<<<
 *     result.init_schema(c_schema)
 *     return result
 */
  __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(3, 1460, __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":1461
 *     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":1462
 *     result = Schema.__new__(Schema)
 *     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":1414
 * 
 * 
 * def schema(fields, dict 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":1465
 * 
 * 
 * def from_numpy_dtype(object dtype):             # <<<<<<<<<<<<<<
 *     """
 *     Convert NumPy dtype to pyarrow.DataType
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_77from_numpy_dtype(PyObject *__pyx_self, PyObject *__pyx_v_dtype); /*proto*/
static char __pyx_doc_7pyarrow_3lib_76from_numpy_dtype[] = "from_numpy_dtype(dtype)\n\n    Convert NumPy dtype to pyarrow.DataType\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_77from_numpy_dtype = {"from_numpy_dtype", (PyCFunction)__pyx_pw_7pyarrow_3lib_77from_numpy_dtype, METH_O, __pyx_doc_7pyarrow_3lib_76from_numpy_dtype};
static PyObject *__pyx_pw_7pyarrow_3lib_77from_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_76from_numpy_dtype(__pyx_self, ((PyObject *)__pyx_v_dtype));

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

static PyObject *__pyx_pf_7pyarrow_3lib_76from_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":1470
 *     """
 *     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(3, 1470, __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(3, 1470, __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(3, 1470, __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":1471
 *     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":1472
 *     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(3, 1472, __pyx_L4_error)
      }

      /* "pyarrow/types.pxi":1471
 *     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":1474
 *         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(3, 1474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1465
 * 
 * 
 * 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":1477
 * 
 * 
 * def is_boolean_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyBool(obj)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_79is_boolean_value(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_78is_boolean_value[] = "is_boolean_value(obj)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_79is_boolean_value = {"is_boolean_value", (PyCFunction)__pyx_pw_7pyarrow_3lib_79is_boolean_value, METH_O, __pyx_doc_7pyarrow_3lib_78is_boolean_value};
static PyObject *__pyx_pw_7pyarrow_3lib_79is_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_78is_boolean_value(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_78is_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":1478
 * 
 * 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(3, 1478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1477
 * 
 * 
 * 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":1481
 * 
 * 
 * def is_integer_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyInt(obj)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_81is_integer_value(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_80is_integer_value[] = "is_integer_value(obj)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_81is_integer_value = {"is_integer_value", (PyCFunction)__pyx_pw_7pyarrow_3lib_81is_integer_value, METH_O, __pyx_doc_7pyarrow_3lib_80is_integer_value};
static PyObject *__pyx_pw_7pyarrow_3lib_81is_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_80is_integer_value(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_80is_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":1482
 * 
 * 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(3, 1482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1481
 * 
 * 
 * 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":1485
 * 
 * 
 * def is_float_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyFloat(obj)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_83is_float_value(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_82is_float_value[] = "is_float_value(obj)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_83is_float_value = {"is_float_value", (PyCFunction)__pyx_pw_7pyarrow_3lib_83is_float_value, METH_O, __pyx_doc_7pyarrow_3lib_82is_float_value};
static PyObject *__pyx_pw_7pyarrow_3lib_83is_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_82is_float_value(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_82is_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":1486
 * 
 * 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(3, 1486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/types.pxi":1485
 * 
 * 
 * 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/scalar.pxi":26
 *     Null (NA) value singleton
 *     """
 *     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":28
 *     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(1, 28, __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":29
 *         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__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 29, __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, 29, __pyx_L1_error)

    /* "pyarrow/scalar.pxi":28
 *     def __cinit__(self):
 *         global NA
 *         if NA is not None:             # <<<<<<<<<<<<<<
 *             raise Exception('Cannot create multiple NAType instances')
 * 
 */
  }

  /* "pyarrow/scalar.pxi":31
 *             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(1, 31, __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(1, 31, __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(1, 31, __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":26
 *     Null (NA) value singleton
 *     """
 *     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":33
 *         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":34
 * 
 *     def __repr__(self):
 *         return 'NULL'             # <<<<<<<<<<<<<<
 * 
 *     def as_py(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_n_s_NULL);
  __pyx_r = __pyx_n_s_NULL;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":33
 *         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":36
 *         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)";
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":37
 * 
 *     def as_py(self):
 *         return None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":36
 *         return 'NULL'
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         return None
 * 
 */

  /* 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_8NullType_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8NullType_6__reduce_cython__[] = "NullType.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_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_8NullType_6__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_6__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__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_8NullType_8__setstate_cython__[] = "NullType.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_8NullType_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_8NullType_8__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_8__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__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":45
 * cdef class ArrayValue(Scalar):
 * 
 *     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":48
 *         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_s_Do_not_call_s_constructor_direct_4, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 48, __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, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 48, __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, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/scalar.pxi":46
 * 
 *     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(1, 46, __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, 46, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":45
 * cdef class ArrayValue(Scalar):
 * 
 *     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":50
 *                         .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":52
 *     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":53
 *                    int64_t index):
 *         self.type = type
 *         self.index = index             # <<<<<<<<<<<<<<
 *         self._set_array(sp_array)
 * 
 */
  __pyx_v_self->index = __pyx_v_index;

  /* "pyarrow/scalar.pxi":54
 *         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":50
 *                         .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":56
 *         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":57
 * 
 *     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":56
 *         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":59
 *         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":60
 * 
 *     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_s_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 60, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/scalar.pxi":61
 *     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(1, 61, __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, 61, __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(1, 61, __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":60
 * 
 *     def __repr__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return repr(self.as_py())
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":63
 *             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(1, 63, __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(1, 63, __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(1, 63, __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(1, 63, __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":59
 *         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":65
 *             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":66
 * 
 *     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_s_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 66, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/scalar.pxi":67
 *     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(1, 67, __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, 67, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 67, __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":66
 * 
 *     def __str__(self):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             return str(self.as_py())
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":69
 *             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(1, 69, __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(1, 69, __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(1, 69, __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(1, 69, __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":65
 *             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":71
 *             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":72
 * 
 *     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_s_as_py); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 72, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (likely(__pyx_t_2)) {

    /* "pyarrow/scalar.pxi":73
 *     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":74
 *         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(1, 74, __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, 74, __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":73
 *     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":75
 *             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(1, 75, __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, 75, __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(1, 75, __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":72
 * 
 *     def __eq__(self, other):
 *         if hasattr(self, 'as_py'):             # <<<<<<<<<<<<<<
 *             if isinstance(other, ArrayValue):
 *                 other = other.as_py()
 */
  }

  /* "pyarrow/scalar.pxi":77
 *             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__20, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 77, __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, 77, __pyx_L1_error)
  }

  /* "pyarrow/scalar.pxi":71
 *             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":80
 *                 "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":81
 * 
 *     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(1, 81, __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, 81, __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(1, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":80
 *                 "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__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":86
 * cdef class BooleanValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CBooleanArray* ap = <CBooleanArray*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

/* 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)";
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":87
 * 
 *     def as_py(self):
 *         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":88
 *     def as_py(self):
 *         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(1, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":86
 * cdef class BooleanValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CBooleanArray* ap = <CBooleanArray*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

  /* 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__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":93
 * cdef class Int8Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CInt8Array* ap = <CInt8Array*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

/* 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)";
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":94
 * 
 *     def as_py(self):
 *         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":95
 *     def as_py(self):
 *         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(1, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":93
 * cdef class Int8Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CInt8Array* ap = <CInt8Array*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

  /* 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__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":100
 * cdef class UInt8Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CUInt8Array* ap = <CUInt8Array*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

/* 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)";
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":101
 * 
 *     def as_py(self):
 *         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":102
 *     def as_py(self):
 *         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(1, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":100
 * cdef class UInt8Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CUInt8Array* ap = <CUInt8Array*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

  /* 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__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":107
 * cdef class Int16Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CInt16Array* ap = <CInt16Array*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

/* 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)";
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":108
 * 
 *     def as_py(self):
 *         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":109
 *     def as_py(self):
 *         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(1, 109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":107
 * cdef class Int16Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CInt16Array* ap = <CInt16Array*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

  /* 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__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":114
 * cdef class UInt16Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CUInt16Array* ap = <CUInt16Array*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

/* 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)";
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":115
 * 
 *     def as_py(self):
 *         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":116
 *     def as_py(self):
 *         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(1, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":114
 * cdef class UInt16Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CUInt16Array* ap = <CUInt16Array*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

  /* 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__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":121
 * cdef class Int32Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CInt32Array* ap = <CInt32Array*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

/* 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)";
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":122
 * 
 *     def as_py(self):
 *         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":123
 *     def as_py(self):
 *         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(1, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":121
 * cdef class Int32Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CInt32Array* ap = <CInt32Array*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

  /* 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__33, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":128
 * cdef class UInt32Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CUInt32Array* ap = <CUInt32Array*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

/* 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)";
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":129
 * 
 *     def as_py(self):
 *         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":130
 *     def as_py(self):
 *         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(1, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":128
 * cdef class UInt32Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CUInt32Array* ap = <CUInt32Array*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

  /* 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__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":135
 * cdef class Int64Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CInt64Array* ap = <CInt64Array*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

/* 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)";
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":136
 * 
 *     def as_py(self):
 *         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":137
 *     def as_py(self):
 *         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(1, 137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":135
 * cdef class Int64Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CInt64Array* ap = <CInt64Array*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

  /* 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__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":142
 * cdef class UInt64Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CUInt64Array* ap = <CUInt64Array*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

/* 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)";
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":143
 * 
 *     def as_py(self):
 *         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":144
 *     def as_py(self):
 *         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(1, 144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":142
 * cdef class UInt64Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CUInt64Array* ap = <CUInt64Array*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

  /* 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__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__40, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":149
 * cdef class Date32Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CDate32Array* ap = <CDate32Array*> self.sp_array.get()
 * 
 */

/* 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)";
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;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":150
 * 
 *     def as_py(self):
 *         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":153
 * 
 *         # Shift to seconds since epoch
 *         return datetime.datetime.utcfromtimestamp(             # <<<<<<<<<<<<<<
 *             int(ap.Value(self.index)) * 86400).date()
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/scalar.pxi":154
 *         # Shift to seconds since epoch
 *         return datetime.datetime.utcfromtimestamp(
 *             int(ap.Value(self.index)) * 86400).date()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pyarrow/scalar.pxi":153
 * 
 *         # Shift to seconds since epoch
 *         return datetime.datetime.utcfromtimestamp(             # <<<<<<<<<<<<<<
 *             int(ap.Value(self.index)) * 86400).date()
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_utcfromtimestamp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/scalar.pxi":154
 *         # Shift to seconds since epoch
 *         return datetime.datetime.utcfromtimestamp(
 *             int(ap.Value(self.index)) * 86400).date()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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(1, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyInt_Type)), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_int_86400); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 154, __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 && 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(1, 153, __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_date); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 154, __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(1, 154, __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":149
 * cdef class Date32Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CDate32Array* ap = <CDate32Array*> self.sp_array.get()
 * 
 */

  /* 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.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__41, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":159
 * cdef class Date64Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()
 *         return datetime.datetime.utcfromtimestamp(
 */

/* 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)";
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;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("as_py", 0);

  /* "pyarrow/scalar.pxi":160
 * 
 *     def as_py(self):
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()             # <<<<<<<<<<<<<<
 *         return datetime.datetime.utcfromtimestamp(
 *             ap.Value(self.index) / 1000).date()
 */
  __pyx_v_ap = (( arrow::Date64Array *)__pyx_v_self->__pyx_base.sp_array.get());

  /* "pyarrow/scalar.pxi":161
 *     def as_py(self):
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()
 *         return datetime.datetime.utcfromtimestamp(             # <<<<<<<<<<<<<<
 *             ap.Value(self.index) / 1000).date()
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/scalar.pxi":162
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()
 *         return datetime.datetime.utcfromtimestamp(
 *             ap.Value(self.index) / 1000).date()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pyarrow/scalar.pxi":161
 *     def as_py(self):
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()
 *         return datetime.datetime.utcfromtimestamp(             # <<<<<<<<<<<<<<
 *             ap.Value(self.index) / 1000).date()
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_utcfromtimestamp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/scalar.pxi":162
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()
 *         return datetime.datetime.utcfromtimestamp(
 *             ap.Value(self.index) / 1000).date()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_From_int64_t(__Pyx_div_int64_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index), 0x3E8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 162, __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(1, 161, __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_date); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 162, __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(1, 162, __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":159
 * cdef class Date64Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CDate64Array* ap = <CDate64Array*> self.sp_array.get()
 *         return datetime.datetime.utcfromtimestamp(
 */

  /* 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.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__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":167
 * cdef class Time32Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CTime32Array* ap = <CTime32Array*> self.sp_array.get()
 */

/* 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)";
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":169
 *     def as_py(self):
 *         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":170
 *         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":172
 *             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":173
 * 
 *         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(1, 173, __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(1, 173, __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(1, 173, __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(1, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_seconds, __pyx_t_4) < 0) __PYX_ERR(1, 173, __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(1, 173, __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":174
 *         if dtype.unit() == TimeUnit_SECOND:
 *             delta = datetime.timedelta(seconds=ap.Value(self.index))
 *             return (datetime.datetime(1970, 1, 1) + delta).time()             # <<<<<<<<<<<<<<
 *         else:
 *             delta = datetime.timedelta(milliseconds=ap.Value(self.index))
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 174, __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(1, 174, __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__45, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 174, __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(1, 174, __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(1, 174, __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(1, 174, __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":172
 *             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":176
 *             return (datetime.datetime(1970, 1, 1) + delta).time()
 *         else:
 *             delta = datetime.timedelta(milliseconds=ap.Value(self.index))             # <<<<<<<<<<<<<<
 *             return (datetime.datetime(1970, 1, 1) + delta).time()
 * 
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 176, __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(1, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyInt_From_int32_t(__pyx_v_ap->Value(__pyx_v_self->__pyx_base.index)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_milliseconds, __pyx_t_3) < 0) __PYX_ERR(1, 176, __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_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_delta = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "pyarrow/scalar.pxi":177
 *         else:
 *             delta = datetime.timedelta(milliseconds=ap.Value(self.index))
 *             return (datetime.datetime(1970, 1, 1) + delta).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_v_delta); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 177, __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_time); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __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_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 177, __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/scalar.pxi":167
 * cdef class Time32Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CTime32Array* ap = <CTime32Array*> self.sp_array.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.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__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":182
 * cdef class Time64Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CTime64Array* ap = <CTime64Array*> self.sp_array.get()
 */

/* 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)";
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":184
 *     def as_py(self):
 *         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":185
 *         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":187
 *             CTime64Type* dtype = <CTime64Type*> ap.type().get()
 * 
 *         cdef int64_t val = ap.Value(self.index)             # <<<<<<<<<<<<<<
 *         if dtype.unit() == TimeUnit_MICRO:
 *             return (datetime.datetime(1970, 1, 1) +
 */
  __pyx_v_val = __pyx_v_ap->Value(__pyx_v_self->__pyx_base.index);

  /* "pyarrow/scalar.pxi":188
 * 
 *         cdef int64_t val = ap.Value(self.index)
 *         if dtype.unit() == TimeUnit_MICRO:             # <<<<<<<<<<<<<<
 *             return (datetime.datetime(1970, 1, 1) +
 *                     datetime.timedelta(microseconds=val)).time()
 */
  __pyx_t_1 = ((__pyx_v_dtype->unit() ==  arrow::TimeUnit::MICRO) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/scalar.pxi":189
 *         cdef int64_t val = ap.Value(self.index)
 *         if dtype.unit() == TimeUnit_MICRO:
 *             return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                     datetime.timedelta(microseconds=val)).time()
 *         else:
 */
    __Pyx_XDECREF(__pyx_r);

    /* "pyarrow/scalar.pxi":190
 *         if dtype.unit() == TimeUnit_MICRO:
 *             return (datetime.datetime(1970, 1, 1) +
 *                     datetime.timedelta(microseconds=val)).time()             # <<<<<<<<<<<<<<
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "pyarrow/scalar.pxi":189
 *         cdef int64_t val = ap.Value(self.index)
 *         if dtype.unit() == TimeUnit_MICRO:
 *             return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                     datetime.timedelta(microseconds=val)).time()
 *         else:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 189, __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__45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/scalar.pxi":190
 *         if dtype.unit() == TimeUnit_MICRO:
 *             return (datetime.datetime(1970, 1, 1) +
 *                     datetime.timedelta(microseconds=val)).time()             # <<<<<<<<<<<<<<
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 190, __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(1, 190, __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(1, 190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_val); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_microseconds, __pyx_t_6) < 0) __PYX_ERR(1, 190, __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(1, 190, __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":189
 *         cdef int64_t val = ap.Value(self.index)
 *         if dtype.unit() == TimeUnit_MICRO:
 *             return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                     datetime.timedelta(microseconds=val)).time()
 *         else:
 */
    __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 189, __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":190
 *         if dtype.unit() == TimeUnit_MICRO:
 *             return (datetime.datetime(1970, 1, 1) +
 *                     datetime.timedelta(microseconds=val)).time()             # <<<<<<<<<<<<<<
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 190, __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(1, 190, __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":188
 * 
 *         cdef int64_t val = ap.Value(self.index)
 *         if dtype.unit() == TimeUnit_MICRO:             # <<<<<<<<<<<<<<
 *             return (datetime.datetime(1970, 1, 1) +
 *                     datetime.timedelta(microseconds=val)).time()
 */
  }

  /* "pyarrow/scalar.pxi":192
 *                     datetime.timedelta(microseconds=val)).time()
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                     datetime.timedelta(microseconds=val / 1000)).time()
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);

    /* "pyarrow/scalar.pxi":193
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +
 *                     datetime.timedelta(microseconds=val / 1000)).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "pyarrow/scalar.pxi":192
 *                     datetime.timedelta(microseconds=val)).time()
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                     datetime.timedelta(microseconds=val / 1000)).time()
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/scalar.pxi":193
 *         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(1, 193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_int64_t(__Pyx_div_int64_t(__pyx_v_val, 0x3E8)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_microseconds, __pyx_t_5) < 0) __PYX_ERR(1, 193, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 193, __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;

    /* "pyarrow/scalar.pxi":192
 *                     datetime.timedelta(microseconds=val)).time()
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                     datetime.timedelta(microseconds=val / 1000)).time()
 * 
 */
    __pyx_t_4 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/scalar.pxi":193
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +
 *                     datetime.timedelta(microseconds=val / 1000)).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 193, __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 && likely(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_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 193, __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/scalar.pxi":182
 * cdef class Time64Value(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CTime64Array* ap = <CTime64Array*> self.sp_array.get()
 */

  /* 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__48, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":232
 * 
 *     @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":233
 *     @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":234
 *     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":235
 *         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(1, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":232
 * 
 *     @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":237
 *         return ap.Value(self.index)
 * 
 *     def as_py(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_1as_py(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_14TimestampValue_as_py[] = "TimestampValue.as_py(self)";
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":238
 * 
 *     def as_py(self):
 *         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":239
 *     def as_py(self):
 *         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":241
 *         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(1, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_value = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":243
 *         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":244
 * 
 *         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(1, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 244, __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(1, 244, __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(1, 244, __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(1, 244, __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":243
 *         value = self.value
 * 
 *         if not dtype.timezone().empty():             # <<<<<<<<<<<<<<
 *             tzinfo = string_to_tzinfo(frombytes(dtype.timezone()))
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/scalar.pxi":246
 *             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":248
 *             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":249
 * 
 *         try:
 *             converter = DATETIME_CONVERSION_FUNCTIONS[dtype.unit()]             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             raise ValueError(
 */
      if (unlikely(__pyx_v_7pyarrow_3lib_DATETIME_CONVERSION_FUNCTIONS == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(1, 249, __pyx_L4_error)
      }
      __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(__pyx_v_dtype->unit()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 249, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_7pyarrow_3lib_DATETIME_CONVERSION_FUNCTIONS, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_converter = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "pyarrow/scalar.pxi":248
 *             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_7); __pyx_t_7 = 0;
    __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;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/scalar.pxi":250
 *         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_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(1, 250, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/scalar.pxi":251
 *             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__50, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __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(1, 251, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "pyarrow/scalar.pxi":248
 *             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":254
 *                 'Cannot convert nanosecond timestamps without pandas'
 *             )
 *         return converter(value, tzinfo=tzinfo)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_value);
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_tzinfo, __pyx_v_tzinfo) < 0) __PYX_ERR(1, 254, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_converter, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":237
 *         return ap.Value(self.index)
 * 
 *     def as_py(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_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__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":259
 * cdef class HalfFloatValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CHalfFloatArray* ap = <CHalfFloatArray*> self.sp_array.get()
 *         return PyHalf_FromHalf(ap.Value(self.index))
 */

/* 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)";
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":260
 * 
 *     def as_py(self):
 *         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":261
 *     def as_py(self):
 *         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(1, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":259
 * cdef class HalfFloatValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CHalfFloatArray* ap = <CHalfFloatArray*> self.sp_array.get()
 *         return PyHalf_FromHalf(ap.Value(self.index))
 */

  /* 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__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":266
 * cdef class FloatValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CFloatArray* ap = <CFloatArray*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

/* 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)";
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":267
 * 
 *     def as_py(self):
 *         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":268
 *     def as_py(self):
 *         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(1, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":266
 * cdef class FloatValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CFloatArray* ap = <CFloatArray*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

  /* 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__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__56, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":273
 * cdef class DoubleValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CDoubleArray* ap = <CDoubleArray*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

/* 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)";
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":274
 * 
 *     def as_py(self):
 *         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":275
 *     def as_py(self):
 *         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(1, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":273
 * cdef class DoubleValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CDoubleArray* ap = <CDoubleArray*> self.sp_array.get()
 *         return ap.Value(self.index)
 */

  /* 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__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":280
 * cdef class DecimalValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CDecimal128Array* ap = <CDecimal128Array*> self.sp_array.get()
 */

/* 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)";
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":282
 *     def as_py(self):
 *         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":283
 *         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":284
 *             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(1, 284, __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(1, 284, __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(1, 284, __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(1, 284, __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":280
 * cdef class DecimalValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CDecimal128Array* ap = <CDecimal128Array*> self.sp_array.get()
 */

  /* 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__59, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__60, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":289
 * cdef class StringValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CStringArray* ap = <CStringArray*> self.sp_array.get()
 *         return ap.GetString(self.index).decode('utf-8')
 */

/* 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)";
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":290
 * 
 *     def as_py(self):
 *         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":291
 *     def as_py(self):
 *         cdef CStringArray* ap = <CStringArray*> self.sp_array.get()
 *         return ap.GetString(self.index).decode('utf-8')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __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(1, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":289
 * cdef class StringValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef CStringArray* ap = <CStringArray*> self.sp_array.get()
 *         return ap.GetString(self.index).decode('utf-8')
 */

  /* 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;
}

/* "(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_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StringValue_2__reduce_cython__[] = "StringValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_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_11StringValue_2__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_2__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__61, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11StringValue_4__setstate_cython__[] = "StringValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11StringValue_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_11StringValue_4__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_4__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__62, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":296
 * cdef class BinaryValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             const uint8_t* ptr
 */

/* 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)";
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":300
 *             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":302
 *             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":303
 * 
 *         ptr = ap.GetValue(self.index, &length)
 *         return cp.PyBytes_FromStringAndSize(<const char*>(ptr), length)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyBytes_FromStringAndSize(((char const *)__pyx_v_ptr), __pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":296
 * cdef class BinaryValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             const uint8_t* ptr
 */

  /* 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;
}

/* "(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_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11BinaryValue_2__reduce_cython__[] = "BinaryValue.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_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_11BinaryValue_2__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_2__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__63, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11BinaryValue_4__setstate_cython__[] = "BinaryValue.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_11BinaryValue_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_11BinaryValue_4__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_4__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__64, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":308
 * cdef class ListValue(ArrayValue):
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_9ListValue_1__len__(PyObject *__pyx_v_self); /*proto*/
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":309
 * 
 *     def __len__(self):
 *         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":308
 * cdef class ListValue(ArrayValue):
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length()
 * 
 */

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

/* "pyarrow/scalar.pxi":311
 *         return self.length()
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
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":312
 * 
 *     def __getitem__(self, i):
 *         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(1, 312, __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(1, 312, __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(1, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":311
 *         return self.length()
 * 
 *     def __getitem__(self, i):             # <<<<<<<<<<<<<<
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 */

  /* 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":314
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_9ListValue_5__iter__(PyObject *__pyx_v_self); /*proto*/
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_3___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_3___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_3___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_3___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(1, 314, __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(1, 314, __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_3___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___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, 314, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":315
 * 
 *     def __iter__(self):
 *         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(1, 315, __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":316
 *     def __iter__(self):
 *         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(1, 316, __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, 316, __pyx_L1_error)
  }

  /* "pyarrow/scalar.pxi":317
 *         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(1, 317, __pyx_L1_error)
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/scalar.pxi":314
 *         return self.getitem(_normalize_index(i, self.length()))
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 */

  /* 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":319
 *         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":320
 * 
 *     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":321
 *     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":322
 *         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(1, 322, __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, 322, __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":319
 *         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":324
 *         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":325
 * 
 *     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":326
 *     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(1, 326, __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":324
 *         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":328
 *         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":329
 * 
 *     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":328
 *         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":331
 *         return self.ap.value_length(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int64_t j
 */

/* 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)";
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":334
 *         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(1, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":336
 *             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(1, 336, __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":337
 * 
 *         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(1, 337, __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(1, 337, __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(1, 337, __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(1, 337, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/scalar.pxi":339
 *             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":331
 *         return self.ap.value_length(self.index)
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int64_t j
 */

  /* 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":141
 * 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__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__66, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":344
 * cdef class UnionValue(ArrayValue):
 * 
 *     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":345
 * 
 *     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":346
 *     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":344
 * cdef class UnionValue(ArrayValue):
 * 
 *     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":348
 *         self.ap = <CUnionArray*> sp_array.get()
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int8_t type_id = self.ap.raw_type_ids()[i]
 *         cdef shared_ptr[CArray] child = self.ap.child(type_id)
 */

static PyObject *__pyx_f_7pyarrow_3lib_10UnionValue_getitem(struct __pyx_obj_7pyarrow_3lib_UnionValue *__pyx_v_self, int64_t __pyx_v_i) {
  int8_t __pyx_v_type_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":349
 * 
 *     cdef getitem(self, int64_t i):
 *         cdef int8_t type_id = self.ap.raw_type_ids()[i]             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CArray] child = self.ap.child(type_id)
 *         if self.ap.mode() == _UnionMode_SPARSE:
 */
  __pyx_v_type_id = (__pyx_v_self->ap->raw_type_ids()[__pyx_v_i]);

  /* "pyarrow/scalar.pxi":350
 *     cdef getitem(self, int64_t i):
 *         cdef int8_t type_id = self.ap.raw_type_ids()[i]
 *         cdef shared_ptr[CArray] child = self.ap.child(type_id)             # <<<<<<<<<<<<<<
 *         if self.ap.mode() == _UnionMode_SPARSE:
 *             return box_scalar(self.type[type_id].type, child, i)
 */
  __pyx_v_child = __pyx_v_self->ap->child(__pyx_v_type_id);

  /* "pyarrow/scalar.pxi":351
 *         cdef int8_t type_id = self.ap.raw_type_ids()[i]
 *         cdef shared_ptr[CArray] child = self.ap.child(type_id)
 *         if self.ap.mode() == _UnionMode_SPARSE:             # <<<<<<<<<<<<<<
 *             return box_scalar(self.type[type_id].type, child, i)
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_self->ap->mode() ==  arrow::UnionMode::SPARSE) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/scalar.pxi":352
 *         cdef shared_ptr[CArray] child = self.ap.child(type_id)
 *         if self.ap.mode() == _UnionMode_SPARSE:
 *             return box_scalar(self.type[type_id].type, child, i)             # <<<<<<<<<<<<<<
 *         else:
 *             return box_scalar(self.type[type_id].type, child,
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.type), __pyx_v_type_id, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 352, __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(1, 352, __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(1, 352, __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(1, 352, __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":351
 *         cdef int8_t type_id = self.ap.raw_type_ids()[i]
 *         cdef shared_ptr[CArray] child = self.ap.child(type_id)
 *         if self.ap.mode() == _UnionMode_SPARSE:             # <<<<<<<<<<<<<<
 *             return box_scalar(self.type[type_id].type, child, i)
 *         else:
 */
  }

  /* "pyarrow/scalar.pxi":354
 *             return box_scalar(self.type[type_id].type, child, i)
 *         else:
 *             return box_scalar(self.type[type_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_type_id, int8_t, 1, __Pyx_PyInt_From_int8_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 354, __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(1, 354, __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(1, 354, __pyx_L1_error)

    /* "pyarrow/scalar.pxi":355
 *         else:
 *             return box_scalar(self.type[type_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(1, 354, __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":348
 *         self.ap = <CUnionArray*> sp_array.get()
 * 
 *     cdef getitem(self, int64_t i):             # <<<<<<<<<<<<<<
 *         cdef int8_t type_id = self.ap.raw_type_ids()[i]
 *         cdef shared_ptr[CArray] child = self.ap.child(type_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":357
 *                               self.ap.value_offset(i))
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         return self.getitem(self.index).as_py()
 * 
 */

/* 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)";
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":358
 * 
 *     def as_py(self):
 *         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(1, 358, __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(1, 358, __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(1, 358, __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":357
 *                               self.ap.value_offset(i))
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         return self.getitem(self.index).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.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__67, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__68, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":363
 * cdef class FixedSizeBinaryValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CFixedSizeBinaryArray* ap
 */

/* 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)";
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":369
 *             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":370
 *             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":371
 *         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":372
 *         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":373
 *         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(1, 373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":363
 * cdef class FixedSizeBinaryValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CFixedSizeBinaryArray* ap
 */

  /* 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__69, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__70, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":378
 * cdef class StructValue(ArrayValue):
 * 
 *     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":379
 * 
 *     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":380
 *     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":378
 * cdef class StructValue(ArrayValue):
 * 
 *     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":382
 *         self.ap = <CStructArray*> sp_array.get()
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CStructType* type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11StructValue_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
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":387
 *             int index
 * 
 *         type = <CStructType*> self.type.type             # <<<<<<<<<<<<<<
 *         index = type.GetChildIndex(tobytes(key))
 * 
 */
  __pyx_v_type = (( arrow::StructType *)__pyx_v_self->__pyx_base.__pyx_base.type->type);

  /* "pyarrow/scalar.pxi":388
 * 
 *         type = <CStructType*> self.type.type
 *         index = type.GetChildIndex(tobytes(key))             # <<<<<<<<<<<<<<
 * 
 *         if index < 0:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 388, __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(1, 388, __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(1, 388, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_index = __pyx_v_type->GetChildIndex(__pyx_t_4);

  /* "pyarrow/scalar.pxi":390
 *         index = type.GetChildIndex(tobytes(key))
 * 
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise KeyError(key)
 * 
 */
  __pyx_t_5 = ((__pyx_v_index < 0) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/scalar.pxi":391
 * 
 *         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(1, 391, __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, 391, __pyx_L1_error)

    /* "pyarrow/scalar.pxi":390
 *         index = type.GetChildIndex(tobytes(key))
 * 
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise KeyError(key)
 * 
 */
  }

  /* "pyarrow/scalar.pxi":393
 *             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(1, 393, __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(1, 393, __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":382
 *         self.ap = <CStructArray*> sp_array.get()
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         cdef:
 *             CStructType* 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.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":395
 *         return pyarrow_wrap_array(self.ap.field(index))[self.index]
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             vector[shared_ptr[CField]] child_fields = self.type.type.children()
 */

/* 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)";
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_v_i;
  std::shared_ptr< arrow::Field>  __pyx_v_child;
  PyObject *__pyx_7genexpr__pyx_v_name = NULL;
  PyObject *__pyx_7genexpr__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":397
 *     def as_py(self):
 *         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":399
 *             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_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/scalar.pxi":400
 * 
 *         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_v_i = __pyx_t_4;

    /* "pyarrow/scalar.pxi":399
 *             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_v_i)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 399, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_v_wrapped_arrays = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":401
 *         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 {
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 401, __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_v_child = __pyx_t_7;
    __pyx_t_5 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_child.get()->name()); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 401, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_v_child_names = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":403
 *         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(1, 403, __pyx_L9_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "pyarrow/scalar.pxi":406
 *             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(1, 406, __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(1, 406, __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(1, 406, __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(1, 406, __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(1, 406, __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(1, 406, __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(1, 406, __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(1, 406, __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(1, 406, __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(1, 405, __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(1, 405, __pyx_L9_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 405, __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(1, 405, __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(1, 405, __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(1, 405, __pyx_L9_error)
        __pyx_L13_unpacking_done:;
      }

      /* "pyarrow/scalar.pxi":405
 *         return {
 *             frombytes(name): child_array[self.index].as_py()
 *             for name, child_array in             # <<<<<<<<<<<<<<
 *             zip(child_names, wrapped_arrays)
 *         }
 */
      __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_name, __pyx_t_11);
      __pyx_t_11 = 0;
      __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_child_array, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "pyarrow/scalar.pxi":404
 *         # 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(1, 404, __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_7genexpr__pyx_v_name) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_7genexpr__pyx_v_name);
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 404, __pyx_L9_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_11 = __Pyx_GetItemInt(__pyx_7genexpr__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(1, 404, __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(1, 404, __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(1, 404, __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(1, 404, __pyx_L9_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "pyarrow/scalar.pxi":405
 *         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_7genexpr__pyx_v_child_array); __pyx_7genexpr__pyx_v_child_array = 0;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_name); __pyx_7genexpr__pyx_v_name = 0;
    goto __pyx_L14_exit_scope;
    __pyx_L9_error:;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_child_array); __pyx_7genexpr__pyx_v_child_array = 0;
    __Pyx_XDECREF(__pyx_7genexpr__pyx_v_name); __pyx_7genexpr__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":395
 *         return pyarrow_wrap_array(self.ap.field(index))[self.index]
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             vector[shared_ptr[CField]] child_fields = self.type.type.children()
 */

  /* 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_7genexpr__pyx_v_name);
  __Pyx_XDECREF(__pyx_7genexpr__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__71, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__72, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":412
 * cdef class DictionaryValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         return self.dictionary_value.as_py()
 * 
 */

/* 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)";
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":413
 * 
 *     def as_py(self):
 *         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(1, 413, __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(1, 413, __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(1, 413, __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":412
 * cdef class DictionaryValue(ArrayValue):
 * 
 *     def as_py(self):             # <<<<<<<<<<<<<<
 *         return self.dictionary_value.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.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":416
 * 
 *     @property
 *     def index_value(self):             # <<<<<<<<<<<<<<
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())
 *         indices = pyarrow_wrap_array(darr.indices())
 */

/* 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":417
 *     @property
 *     def index_value(self):
 *         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":418
 *     def index_value(self):
 *         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(1, 418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_indices = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":419
 *         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(1, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/scalar.pxi":416
 * 
 *     @property
 *     def index_value(self):             # <<<<<<<<<<<<<<
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())
 *         indices = pyarrow_wrap_array(darr.indices())
 */

  /* 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":422
 * 
 *     @property
 *     def dictionary_value(self):             # <<<<<<<<<<<<<<
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())
 *         dictionary = pyarrow_wrap_array(darr.dictionary())
 */

/* 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":423
 *     @property
 *     def dictionary_value(self):
 *         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":424
 *     def dictionary_value(self):
 *         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(1, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dictionary = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/scalar.pxi":425
 *         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(1, 425, __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(1, 425, __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(1, 425, __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(1, 425, __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":422
 * 
 *     @property
 *     def dictionary_value(self):             # <<<<<<<<<<<<<<
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.sp_array.get())
 *         dictionary = pyarrow_wrap_array(darr.dictionary())
 */

  /* 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__73, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__74, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":457
 * 
 * 
 * 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":461
 *     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":462
 * 
 *     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(1, 462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":461
 *     cdef ArrayValue value
 * 
 *     if type.type.id() == _Type_NA:             # <<<<<<<<<<<<<<
 *         return _NULL
 *     elif sp_array.get().IsNull(index):
 */
  }

  /* "pyarrow/scalar.pxi":463
 *     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":464
 *         return _NULL
 *     elif sp_array.get().IsNull(index):
 *         return _NULL             # <<<<<<<<<<<<<<
 *     else:
 *         klass = _scalar_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(1, 464, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/scalar.pxi":463
 *     if type.type.id() == _Type_NA:
 *         return _NULL
 *     elif sp_array.get().IsNull(index):             # <<<<<<<<<<<<<<
 *         return _NULL
 *     else:
 */
  }

  /* "pyarrow/scalar.pxi":466
 *         return _NULL
 *     else:
 *         klass = _scalar_classes[type.type.id()]             # <<<<<<<<<<<<<<
 *         value = klass.__new__(klass)
 *         value.init(type, sp_array, index)
 */
  /*else*/ {
    if (unlikely(__pyx_v_7pyarrow_3lib__scalar_classes == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 466, __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(1, 466, __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(1, 466, __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":467
 *     else:
 *         klass = _scalar_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(1, 467, __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(1, 467, __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(1, 467, __pyx_L1_error)
    __pyx_v_value = ((struct __pyx_obj_7pyarrow_3lib_ArrayValue *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/scalar.pxi":468
 *         klass = _scalar_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":469
 *         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":457
 * 
 * 
 * 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":19
 * 
 * 
 * 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":24
 *     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":25
 * 
 *     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":24
 *     cdef PyConversionOptions options
 * 
 *     if type is not None:             # <<<<<<<<<<<<<<
 *         options.type = type.sp_type
 * 
 */
  }

  /* "pyarrow/array.pxi":27
 *         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":28
 * 
 *     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(2, 28, __pyx_L1_error)
    __pyx_v_options.size = __pyx_t_4;

    /* "pyarrow/array.pxi":27
 *         options.type = type.sp_type
 * 
 *     if size is not None:             # <<<<<<<<<<<<<<
 *         options.size = size
 * 
 */
  }

  /* "pyarrow/array.pxi":30
 *         options.size = size
 * 
 *     options.pool = pool             # <<<<<<<<<<<<<<
 *     options.from_pandas = from_pandas
 * 
 */
  __pyx_v_options.pool = __pyx_v_pool;

  /* "pyarrow/array.pxi":31
 * 
 *     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":35
 *     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":36
 * 
 *     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(2, 36, __pyx_L6_error)
      }

      /* "pyarrow/array.pxi":35
 *     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":38
 *         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":39
 * 
 *     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(2, 39, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":38
 *         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":41
 *         return pyarrow_wrap_array(out.get().chunk(0))
 *     else:
 *         return pyarrow_wrap_chunked_array(out)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = pyarrow_wrap_chunked_array(__pyx_v_out); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 41, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":19
 * 
 * 
 * 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":44
 * 
 * 
 * cdef _is_array_like(obj):             # <<<<<<<<<<<<<<
 *     try:
 *         import pandas
 */

static PyObject *__pyx_f_7pyarrow_3lib__is_array_like(PyObject *__pyx_v_obj) {
  CYTHON_UNUSED PyObject *__pyx_v_pandas = 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;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("_is_array_like", 0);

  /* "pyarrow/array.pxi":45
 * 
 * cdef _is_array_like(obj):
 *     try:             # <<<<<<<<<<<<<<
 *         import pandas
 *         return isinstance(obj, (np.ndarray, pd.Series, pd.Index, Categorical))
 */
  {
    __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/array.pxi":46
 * cdef _is_array_like(obj):
 *     try:
 *         import pandas             # <<<<<<<<<<<<<<
 *         return isinstance(obj, (np.ndarray, pd.Series, pd.Index, Categorical))
 *     except ImportError:
 */
      __pyx_t_4 = __Pyx_Import(__pyx_n_s_pandas, 0, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 46, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_v_pandas = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "pyarrow/array.pxi":47
 *     try:
 *         import pandas
 *         return isinstance(obj, (np.ndarray, pd.Series, pd.Index, Categorical))             # <<<<<<<<<<<<<<
 *     except ImportError:
 *         return isinstance(obj, np.ndarray)
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 47, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 47, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pd); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 47, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Series); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 47, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pd); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 47, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Index); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 47, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Categorical); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 47, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_9 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_5); 
      __pyx_t_10 = (__pyx_t_9 != 0);
      if (!__pyx_t_10) {
      } else {
        __pyx_t_8 = __pyx_t_10;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_10 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_6); 
      __pyx_t_9 = (__pyx_t_10 != 0);
      if (!__pyx_t_9) {
      } else {
        __pyx_t_8 = __pyx_t_9;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_9 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_7); 
      __pyx_t_10 = (__pyx_t_9 != 0);
      if (!__pyx_t_10) {
      } else {
        __pyx_t_8 = __pyx_t_10;
        goto __pyx_L9_bool_binop_done;
      }
      __pyx_t_10 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_4); 
      __pyx_t_9 = (__pyx_t_10 != 0);
      __pyx_t_8 = __pyx_t_9;
      __pyx_L9_bool_binop_done:;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __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_t_5 = __Pyx_PyBool_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 47, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L7_try_return;

      /* "pyarrow/array.pxi":45
 * 
 * cdef _is_array_like(obj):
 *     try:             # <<<<<<<<<<<<<<
 *         import pandas
 *         return isinstance(obj, (np.ndarray, pd.Series, pd.Index, Categorical))
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/array.pxi":48
 *         import pandas
 *         return isinstance(obj, (np.ndarray, pd.Series, pd.Index, Categorical))
 *     except ImportError:             # <<<<<<<<<<<<<<
 *         return isinstance(obj, np.ndarray)
 * 
 */
    __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_11) {
      __Pyx_AddTraceback("pyarrow.lib._is_array_like", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 48, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);

      /* "pyarrow/array.pxi":49
 *         return isinstance(obj, (np.ndarray, pd.Series, pd.Index, Categorical))
 *     except ImportError:
 *         return isinstance(obj, np.ndarray)             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 49, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 49, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_12); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 49, __pyx_L5_except_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = __Pyx_PyBool_FromLong(__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(2, 49, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_r = __pyx_t_12;
      __pyx_t_12 = 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;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "pyarrow/array.pxi":45
 * 
 * cdef _is_array_like(obj):
 *     try:             # <<<<<<<<<<<<<<
 *         import pandas
 *         return isinstance(obj, (np.ndarray, pd.Series, pd.Index, Categorical))
 */
    __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/array.pxi":44
 * 
 * 
 * cdef _is_array_like(obj):             # <<<<<<<<<<<<<<
 *     try:
 *         import pandas
 */

  /* 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_12);
  __Pyx_AddTraceback("pyarrow.lib._is_array_like", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pandas);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":52
 * 
 * 
 * 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_v_dtype = NULL;
  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;
  std::shared_ptr< arrow::DataType>  __pyx_t_6;
  __Pyx_RefNannySetupContext("_ndarray_to_array", 0);

  /* "pyarrow/array.pxi":57
 *         shared_ptr[CChunkedArray] chunked_out
 *         shared_ptr[CDataType] c_type
 *         CCastOptions cast_options = CCastOptions(safe)             # <<<<<<<<<<<<<<
 * 
 *     dtype = values.dtype
 */
  __pyx_v_cast_options =  arrow::compute::CastOptions(__pyx_v_safe);

  /* "pyarrow/array.pxi":59
 *         CCastOptions cast_options = CCastOptions(safe)
 * 
 *     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(2, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_dtype = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":61
 *     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(2, 61, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 61, __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":62
 * 
 *     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":63
 *     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(2, 63, __pyx_L7_error)
        }

        /* "pyarrow/array.pxi":62
 * 
 *     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":61
 *     dtype = values.dtype
 * 
 *     if type is None and dtype != object:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))
 */
  }

  /* "pyarrow/array.pxi":65
 *             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":66
 * 
 *     if type is not None:
 *         c_type = type.sp_type             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
    __pyx_t_6 = __pyx_v_type->sp_type;
    __pyx_v_c_type = __pyx_t_6;

    /* "pyarrow/array.pxi":65
 *             check_status(NumPyDtypeToArrow(dtype, &c_type))
 * 
 *     if type is not None:             # <<<<<<<<<<<<<<
 *         c_type = type.sp_type
 * 
 */
  }

  /* "pyarrow/array.pxi":68
 *         c_type = type.sp_type
 * 
 *     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":69
 * 
 *     with nogil:
 *         check_status(NdarrayToArrow(pool, values, mask, from_pandas,             # <<<<<<<<<<<<<<
 *                                     c_type, cast_options, &chunked_out))
 * 
 */
        __pyx_t_5 = __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_5 == ((int)-1))) __PYX_ERR(2, 69, __pyx_L11_error)
      }

      /* "pyarrow/array.pxi":68
 *         c_type = type.sp_type
 * 
 *     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_L12;
        }
        __pyx_L11_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L12:;
      }
  }

  /* "pyarrow/array.pxi":72
 *                                     c_type, cast_options, &chunked_out))
 * 
 *     if chunked_out.get().num_chunks() > 1:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_chunked_array(chunked_out)
 *     else:
 */
  __pyx_t_4 = ((__pyx_v_chunked_out.get()->num_chunks() > 1) != 0);
  if (__pyx_t_4) {

    /* "pyarrow/array.pxi":73
 * 
 *     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_1 = pyarrow_wrap_chunked_array(__pyx_v_chunked_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 73, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":72
 *                                     c_type, cast_options, &chunked_out))
 * 
 *     if chunked_out.get().num_chunks() > 1:             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_chunked_array(chunked_out)
 *     else:
 */
  }

  /* "pyarrow/array.pxi":75
 *         return pyarrow_wrap_chunked_array(chunked_out)
 *     else:
 *         return pyarrow_wrap_array(chunked_out.get().chunk(0))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_chunked_out.get()->chunk(0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":52
 * 
 * 
 * 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_1);
  __Pyx_AddTraceback("pyarrow.lib._ndarray_to_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":78
 * 
 * 
 * cdef inline DataType _ensure_type(object type):             # <<<<<<<<<<<<<<
 *     if type is None:
 *         return None
 */

static CYTHON_INLINE struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_f_7pyarrow_3lib__ensure_type(PyObject *__pyx_v_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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_ensure_type", 0);

  /* "pyarrow/array.pxi":79
 * 
 * cdef inline DataType _ensure_type(object type):
 *     if type is None:             # <<<<<<<<<<<<<<
 *         return None
 *     elif not isinstance(type, DataType):
 */
  __pyx_t_1 = (__pyx_v_type == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":80
 * cdef inline DataType _ensure_type(object type):
 *     if type is None:
 *         return None             # <<<<<<<<<<<<<<
 *     elif not isinstance(type, DataType):
 *         return type_for_alias(type)
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/array.pxi":79
 * 
 * cdef inline DataType _ensure_type(object type):
 *     if type is None:             # <<<<<<<<<<<<<<
 *         return None
 *     elif not isinstance(type, DataType):
 */
  }

  /* "pyarrow/array.pxi":81
 *     if type is None:
 *         return None
 *     elif not isinstance(type, DataType):             # <<<<<<<<<<<<<<
 *         return type_for_alias(type)
 *     else:
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_type, __pyx_ptype_7pyarrow_3lib_DataType); 
  __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":82
 *         return None
 *     elif not isinstance(type, DataType):
 *         return type_for_alias(type)             # <<<<<<<<<<<<<<
 *     else:
 *         return type
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_type_for_alias); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 82, __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_type) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_type);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 82, __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_DataType))))) __PYX_ERR(2, 82, __pyx_L1_error)
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":81
 *     if type is None:
 *         return None
 *     elif not isinstance(type, DataType):             # <<<<<<<<<<<<<<
 *         return type_for_alias(type)
 *     else:
 */
  }

  /* "pyarrow/array.pxi":84
 *         return type_for_alias(type)
 *     else:
 *         return type             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    if (!(likely(((__pyx_v_type) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_type, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(2, 84, __pyx_L1_error)
    __Pyx_INCREF(__pyx_v_type);
    __pyx_r = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_type);
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":78
 * 
 * 
 * cdef inline DataType _ensure_type(object type):             # <<<<<<<<<<<<<<
 *     if type is None:
 *         return 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._ensure_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":87
 * 
 * 
 * def array(object obj, type=None, mask=None, size=None, bint from_pandas=False,             # <<<<<<<<<<<<<<
 *           bint safe=True, MemoryPool memory_pool=None):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_85array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_84array[] = "array(obj, type=None, mask=None, size=None, bool from_pandas=False, 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 False\n        Use pandas's semantics for inferring nulls from values in ndarray-like\n        data. If passed, the mask tasks precendence, but if a value is unmasked\n        (not-null), but still null according to pandas semantics, then it is\n        null\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 (if object data\n    overflowed binary storage)\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_85array = {"array", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_85array, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_84array};
static PyObject *__pyx_pw_7pyarrow_3lib_85array(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;
  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("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);

    /* "pyarrow/array.pxi":88
 * 
 * def array(object obj, type=None, mask=None, size=None, bint from_pandas=False,
 *           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(2, 87, __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];
    if (values[4]) {
      __pyx_v_from_pandas = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_from_pandas == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 87, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":87
 * 
 * 
 * def array(object obj, type=None, mask=None, size=None, 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(2, 88, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":88
 * 
 * def array(object obj, type=None, mask=None, size=None, bint from_pandas=False,
 *           bint safe=True, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create pyarrow.Array instance from a Python object
 */
      __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(2, 87, __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(2, 88, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_84array(__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":87
 * 
 * 
 * def array(object obj, type=None, mask=None, size=None, 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_84array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, PyObject *__pyx_v_type, PyObject *__pyx_v_mask, PyObject *__pyx_v_size, int __pyx_v_from_pandas, int __pyx_v_safe, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
   arrow::MemoryPool *__pyx_v_pool;
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_v_pdcompat = 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;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  __Pyx_RefNannySetupContext("array", 0);
  __Pyx_INCREF(__pyx_v_type);
  __Pyx_INCREF(__pyx_v_mask);

  /* "pyarrow/array.pxi":150
 *     overflowed binary storage)
 *     """
 *     type = _ensure_type(type)             # <<<<<<<<<<<<<<
 *     cdef CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_f_7pyarrow_3lib__ensure_type(__pyx_v_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_type, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":151
 *     """
 *     type = _ensure_type(type)
 *     cdef CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 * 
 *     if _is_array_like(obj):
 */
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/array.pxi":153
 *     cdef CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *     if _is_array_like(obj):             # <<<<<<<<<<<<<<
 *         if mask is not None:
 *             mask = get_series_values(mask)
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib__is_array_like(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 153, __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, 153, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":154
 * 
 *     if _is_array_like(obj):
 *         if mask is not None:             # <<<<<<<<<<<<<<
 *             mask = get_series_values(mask)
 * 
 */
    __pyx_t_2 = (__pyx_v_mask != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "pyarrow/array.pxi":155
 *     if _is_array_like(obj):
 *         if mask is not None:
 *             mask = get_series_values(mask)             # <<<<<<<<<<<<<<
 * 
 *         values = get_series_values(obj)
 */
      __pyx_t_1 = __pyx_f_7pyarrow_3lib_get_series_values(__pyx_v_mask); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 155, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_mask, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "pyarrow/array.pxi":154
 * 
 *     if _is_array_like(obj):
 *         if mask is not None:             # <<<<<<<<<<<<<<
 *             mask = get_series_values(mask)
 * 
 */
    }

    /* "pyarrow/array.pxi":157
 *             mask = get_series_values(mask)
 * 
 *         values = get_series_values(obj)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(values, Categorical):
 */
    __pyx_t_1 = __pyx_f_7pyarrow_3lib_get_series_values(__pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_values = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":159
 *         values = get_series_values(obj)
 * 
 *         if isinstance(values, Categorical):             # <<<<<<<<<<<<<<
 *             return DictionaryArray.from_arrays(
 *                 values.codes, values.categories.values,
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Categorical); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyObject_IsInstance(__pyx_v_values, __pyx_t_1); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 159, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (__pyx_t_2) {

      /* "pyarrow/array.pxi":160
 * 
 *         if isinstance(values, Categorical):
 *             return DictionaryArray.from_arrays(             # <<<<<<<<<<<<<<
 *                 values.codes, values.categories.values,
 *                 mask=mask, ordered=values.ordered,
 */
      __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(2, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);

      /* "pyarrow/array.pxi":161
 *         if isinstance(values, Categorical):
 *             return DictionaryArray.from_arrays(
 *                 values.codes, values.categories.values,             # <<<<<<<<<<<<<<
 *                 mask=mask, ordered=values.ordered,
 *                 from_pandas=True, safe=safe,
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_codes); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_categories); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_values); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pyarrow/array.pxi":160
 * 
 *         if isinstance(values, Categorical):
 *             return DictionaryArray.from_arrays(             # <<<<<<<<<<<<<<
 *                 values.codes, values.categories.values,
 *                 mask=mask, ordered=values.ordered,
 */
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 160, __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_6);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
      __pyx_t_4 = 0;
      __pyx_t_6 = 0;

      /* "pyarrow/array.pxi":162
 *             return DictionaryArray.from_arrays(
 *                 values.codes, values.categories.values,
 *                 mask=mask, ordered=values.ordered,             # <<<<<<<<<<<<<<
 *                 from_pandas=True, safe=safe,
 *                 memory_pool=memory_pool)
 */
      __pyx_t_6 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mask, __pyx_v_mask) < 0) __PYX_ERR(2, 162, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_ordered); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_ordered, __pyx_t_4) < 0) __PYX_ERR(2, 162, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/array.pxi":163
 *                 values.codes, values.categories.values,
 *                 mask=mask, ordered=values.ordered,
 *                 from_pandas=True, safe=safe,             # <<<<<<<<<<<<<<
 *                 memory_pool=memory_pool)
 *         else:
 */
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_from_pandas, Py_True) < 0) __PYX_ERR(2, 162, __pyx_L1_error)
      __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_safe); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_safe, __pyx_t_4) < 0) __PYX_ERR(2, 162, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/array.pxi":164
 *                 mask=mask, ordered=values.ordered,
 *                 from_pandas=True, safe=safe,
 *                 memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 *         else:
 *             import pyarrow.pandas_compat as pdcompat
 */
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < 0) __PYX_ERR(2, 162, __pyx_L1_error)

      /* "pyarrow/array.pxi":160
 * 
 *         if isinstance(values, Categorical):
 *             return DictionaryArray.from_arrays(             # <<<<<<<<<<<<<<
 *                 values.codes, values.categories.values,
 *                 mask=mask, ordered=values.ordered,
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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/array.pxi":159
 *         values = get_series_values(obj)
 * 
 *         if isinstance(values, Categorical):             # <<<<<<<<<<<<<<
 *             return DictionaryArray.from_arrays(
 *                 values.codes, values.categories.values,
 */
    }

    /* "pyarrow/array.pxi":166
 *                 memory_pool=memory_pool)
 *         else:
 *             import pyarrow.pandas_compat as pdcompat             # <<<<<<<<<<<<<<
 *             values, type = pdcompat.get_datetimetz_type(values, obj.dtype,
 *                                                         type)
 */
    /*else*/ {
      __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_n_s__75);
      __Pyx_GIVEREF(__pyx_n_s__75);
      PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s__75);
      __pyx_t_6 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_4, -1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_pdcompat = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "pyarrow/array.pxi":167
 *         else:
 *             import pyarrow.pandas_compat as pdcompat
 *             values, type = pdcompat.get_datetimetz_type(values, obj.dtype,             # <<<<<<<<<<<<<<
 *                                                         type)
 *             return _ndarray_to_array(values, mask, type, from_pandas, safe,
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pdcompat, __pyx_n_s_get_datetimetz_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "pyarrow/array.pxi":168
 *             import pyarrow.pandas_compat as pdcompat
 *             values, type = pdcompat.get_datetimetz_type(values, obj.dtype,
 *                                                         type)             # <<<<<<<<<<<<<<
 *             return _ndarray_to_array(values, mask, type, from_pandas, safe,
 *                                      pool)
 */
      __pyx_t_1 = NULL;
      __pyx_t_7 = 0;
      if (CYTHON_UNPACK_METHODS && likely(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_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_v_values, __pyx_t_5, __pyx_v_type};
        __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 167, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __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[4] = {__pyx_t_1, __pyx_v_values, __pyx_t_5, __pyx_v_type};
        __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 167, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        if (__pyx_t_1) {
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __pyx_t_1 = NULL;
        }
        __Pyx_INCREF(__pyx_v_values);
        __Pyx_GIVEREF(__pyx_v_values);
        PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_values);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
        __Pyx_INCREF(__pyx_v_type);
        __Pyx_GIVEREF(__pyx_v_type);
        PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_type);
        __pyx_t_5 = 0;
        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
        PyObject* sequence = __pyx_t_6;
        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(2, 167, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_8);
        #else
        __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext;
        index = 0; __pyx_t_4 = __pyx_t_9(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_5), 2) < 0) __PYX_ERR(2, 167, __pyx_L1_error)
        __pyx_t_9 = 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_9 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(2, 167, __pyx_L1_error)
        __pyx_L7_unpacking_done:;
      }

      /* "pyarrow/array.pxi":167
 *         else:
 *             import pyarrow.pandas_compat as pdcompat
 *             values, type = pdcompat.get_datetimetz_type(values, obj.dtype,             # <<<<<<<<<<<<<<
 *                                                         type)
 *             return _ndarray_to_array(values, mask, type, from_pandas, safe,
 */
      __Pyx_DECREF_SET(__pyx_v_values, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_type, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "pyarrow/array.pxi":169
 *             values, type = pdcompat.get_datetimetz_type(values, obj.dtype,
 *                                                         type)
 *             return _ndarray_to_array(values, mask, type, 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(2, 169, __pyx_L1_error)

      /* "pyarrow/array.pxi":170
 *                                                         type)
 *             return _ndarray_to_array(values, mask, type, from_pandas, safe,
 *                                      pool)             # <<<<<<<<<<<<<<
 *     else:
 *         # ConvertPySequence does strict conversion if type is explicitly passed
 */
      __pyx_t_6 = __pyx_f_7pyarrow_3lib__ndarray_to_array(__pyx_v_values, __pyx_v_mask, ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_v_type), __pyx_v_from_pandas, __pyx_v_safe, __pyx_v_pool); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_r = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L0;
    }

    /* "pyarrow/array.pxi":153
 *     cdef CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *     if _is_array_like(obj):             # <<<<<<<<<<<<<<
 *         if mask is not None:
 *             mask = get_series_values(mask)
 */
  }

  /* "pyarrow/array.pxi":173
 *     else:
 *         # ConvertPySequence does strict conversion if type is explicitly passed
 *         return _sequence_to_array(obj, mask, size, type, pool, 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(2, 173, __pyx_L1_error)
    __pyx_t_6 = __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_from_pandas); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 173, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":87
 * 
 * 
 * def array(object obj, type=None, mask=None, size=None, bint from_pandas=False,             # <<<<<<<<<<<<<<
 *           bint safe=True, MemoryPool memory_pool=None):
 *     """
 */

  /* 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_8);
  __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_pdcompat);
  __Pyx_XDECREF(__pyx_v_type);
  __Pyx_XDECREF(__pyx_v_mask);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":176
 * 
 * 
 * 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_87asarray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_86asarray[] = "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 (sequence, numpy.ndarray, pyarrow.Array)\n    type : string or DataType\n\n    Returns\n    -------\n    arr : Array\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_87asarray = {"asarray", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_87asarray, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_86asarray};
static PyObject *__pyx_pw_7pyarrow_3lib_87asarray(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(2, 176, __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(2, 176, __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_86asarray(__pyx_self, __pyx_v_values, __pyx_v_type);

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

static PyObject *__pyx_pf_7pyarrow_3lib_86asarray(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":190
 *     arr : Array
 *     """
 *     if isinstance(values, Array):             # <<<<<<<<<<<<<<
 *         if type is not None and not values.type.equals(type):
 *             values = values.cast(type)
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_values, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":191
 *     """
 *     if isinstance(values, Array):
 *         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_L5_bool_binop_done;
    }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_values, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 191, __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(2, 191, __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(2, 191, __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(2, 191, __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_L5_bool_binop_done:;
    if (__pyx_t_2) {

      /* "pyarrow/array.pxi":192
 *     if isinstance(values, Array):
 *         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(2, 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(2, 192, __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":191
 *     """
 *     if isinstance(values, Array):
 *         if type is not None and not values.type.equals(type):             # <<<<<<<<<<<<<<
 *             values = values.cast(type)
 * 
 */
    }

    /* "pyarrow/array.pxi":194
 *             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":190
 *     arr : Array
 *     """
 *     if isinstance(values, Array):             # <<<<<<<<<<<<<<
 *         if type is not None and not values.type.equals(type):
 *             values = values.cast(type)
 */
  }

  /* "pyarrow/array.pxi":196
 *         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(2, 196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 196, __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(2, 196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_type, __pyx_v_type) < 0) __PYX_ERR(2, 196, __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(2, 196, __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":176
 * 
 * 
 * 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":199
 * 
 * 
 * def _normalize_slice(object arrow_obj, slice key):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t start, stop, step
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_89_normalize_slice(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_88_normalize_slice[] = "_normalize_slice(arrow_obj, slice key)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_89_normalize_slice = {"_normalize_slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_89_normalize_slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_88_normalize_slice};
static PyObject *__pyx_pw_7pyarrow_3lib_89_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(2, 199, __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(2, 199, __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(2, 199, __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(2, 199, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_88_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_88_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":202
 *     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(2, 202, __pyx_L1_error)
  __pyx_v_n = __pyx_t_1;

  /* "pyarrow/array.pxi":204
 *         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(2, 204, __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(2, 204, __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":205
 * 
 *     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":206
 *     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":207
 *     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":208
 *         start += n
 *         if start < 0:
 *             start = 0             # <<<<<<<<<<<<<<
 *     elif start >= n:
 *         start = n
 */
      __pyx_v_start = 0;

      /* "pyarrow/array.pxi":207
 *     if start < 0:
 *         start += n
 *         if start < 0:             # <<<<<<<<<<<<<<
 *             start = 0
 *     elif start >= n:
 */
    }

    /* "pyarrow/array.pxi":205
 * 
 *     start = key.start or 0
 *     if start < 0:             # <<<<<<<<<<<<<<
 *         start += n
 *         if start < 0:
 */
    goto __pyx_L5;
  }

  /* "pyarrow/array.pxi":209
 *         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":210
 *             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":209
 *         if start < 0:
 *             start = 0
 *     elif start >= n:             # <<<<<<<<<<<<<<
 *         start = n
 * 
 */
  }
  __pyx_L5:;

  /* "pyarrow/array.pxi":212
 *         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(2, 212, __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":213
 * 
 *     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":214
 *     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":215
 *     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":216
 *         stop += n
 *         if stop < 0:
 *             stop = 0             # <<<<<<<<<<<<<<
 *     elif stop >= n:
 *         stop = n
 */
      __pyx_v_stop = 0;

      /* "pyarrow/array.pxi":215
 *     if stop < 0:
 *         stop += n
 *         if stop < 0:             # <<<<<<<<<<<<<<
 *             stop = 0
 *     elif stop >= n:
 */
    }

    /* "pyarrow/array.pxi":213
 * 
 *     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":217
 *         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":218
 *             stop = 0
 *     elif stop >= n:
 *         stop = n             # <<<<<<<<<<<<<<
 * 
 *     step = key.step or 1
 */
    __pyx_v_stop = __pyx_v_n;

    /* "pyarrow/array.pxi":217
 *         if stop < 0:
 *             stop = 0
 *     elif stop >= n:             # <<<<<<<<<<<<<<
 *         stop = n
 * 
 */
  }
  __pyx_L7:;

  /* "pyarrow/array.pxi":220
 *         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(2, 220, __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(2, 220, __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":221
 * 
 *     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":222
 *     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__76, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 222, __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(2, 222, __pyx_L1_error)

    /* "pyarrow/array.pxi":221
 * 
 *     step = key.step or 1
 *     if step != 1:             # <<<<<<<<<<<<<<
 *         raise IndexError('only slices with step 1 supported')
 *     else:
 */
  }

  /* "pyarrow/array.pxi":224
 *         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(2, 224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 224, __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(2, 224, __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(2, 224, __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(2, 224, __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(2, 224, __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(2, 224, __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":199
 * 
 * 
 * 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":227
 * 
 * 
 * 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":229
 * 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":230
 *                                  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":231
 *     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":232
 *         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__77, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 232, __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, 232, __pyx_L1_error)

      /* "pyarrow/array.pxi":231
 *     if index < 0:
 *         index += length
 *         if index < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError("index out of bounds")
 *     elif index >= length:
 */
    }

    /* "pyarrow/array.pxi":229
 * 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":233
 *         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":234
 *             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__77, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 234, __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, 234, __pyx_L1_error)

    /* "pyarrow/array.pxi":233
 *         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":235
 *     elif index >= length:
 *         raise IndexError("index out of bounds")
 *     return index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_index;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":227
 * 
 * 
 * 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":242
 *         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":243
 * 
 *     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":242
 *         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__78, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__79, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":247
 * 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":248
 * 
 * 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":247
 * 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":251
 * 
 * 
 * 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":252
 * 
 * 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":253
 * 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(2, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":252
 * 
 * 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":254
 *     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())
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_datum.kind() ==  arrow::compute::Datum::CHUNKED_ARRAY) != 0);
  if (likely(__pyx_t_1)) {

    /* "pyarrow/array.pxi":255
 *         return pyarrow_wrap_array(MakeArray(datum.array()))
 *     elif datum.kind() == DatumType_CHUNKED_ARRAY:
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError("Unable to wrap Datum in a Python object")
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = pyarrow_wrap_chunked_array(__pyx_v_datum.chunked_array()); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/array.pxi":254
 *     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())
 *     else:
 */
  }

  /* "pyarrow/array.pxi":257
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())
 *     else:
 *         raise ValueError("Unable to wrap Datum in a Python object")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 257, __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, 257, __pyx_L1_error)
  }

  /* "pyarrow/array.pxi":251
 * 
 * 
 * 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":260
 * 
 * 
 * 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":265
 *     """
 *     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(2, 265, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/array.pxi":266
 *     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":267
 *     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":268
 *     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":269
 *     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(2, 269, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":270
 *         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":269
 *     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(2, 269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {

      /* "pyarrow/array.pxi":270
 *         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":269
 *     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(2, 269, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "pyarrow/array.pxi":271
 *         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":272
 *                    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":273
 *     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(2, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

  /* "pyarrow/array.pxi":260
 * 
 * 
 * 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":276
 * 
 * 
 * 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_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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("_reduce_array_data", 0);

  /* "pyarrow/array.pxi":281
 *     """
 *     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(2, 281, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/array.pxi":283
 *     assert ad != NULL
 * 
 *     n = ad.buffers.size()             # <<<<<<<<<<<<<<
 *     buffers = []
 *     for i in range(n):
 */
  __pyx_v_n = __pyx_v_ad->buffers.size();

  /* "pyarrow/array.pxi":284
 * 
 *     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(2, 284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_buffers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":285
 *     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":286
 *     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":288
 *         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":287
 *     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(2, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __pyx_t_5;
      __pyx_t_5 = 0;
    } else {

      /* "pyarrow/array.pxi":288
 *         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":287
 *     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(2, 287, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/array.pxi":290
 *                        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(2, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_children = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":291
 * 
 *     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":292
 *     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":293
 *     n = ad.child_data.size()
 *     for i in range(n):
 *         children.append(_reduce_array_data(ad.child_data[i].get()))             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_data_type(ad.type), ad.length, ad.null_count, \
 */
    __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(2, 293, __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(2, 293, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/array.pxi":295
 *         children.append(_reduce_array_data(ad.child_data[i].get()))
 * 
 *     return pyarrow_wrap_data_type(ad.type), ad.length, ad.null_count, \             # <<<<<<<<<<<<<<
 *         ad.offset, buffers, children
 * 
 */
  __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(2, 295, __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(2, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyInt_From_int64_t(__pyx_v_ad->null_count); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/array.pxi":296
 * 
 *     return pyarrow_wrap_data_type(ad.type), ad.length, ad.null_count, \
 *         ad.offset, buffers, children             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_8 = __Pyx_PyInt_From_int64_t(__pyx_v_ad->offset); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pyarrow/array.pxi":295
 *         children.append(_reduce_array_data(ad.child_data[i].get()))
 * 
 *     return pyarrow_wrap_data_type(ad.type), ad.length, ad.null_count, \             # <<<<<<<<<<<<<<
 *         ad.offset, buffers, children
 * 
 */
  __pyx_t_9 = PyTuple_New(6); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_8);
  __Pyx_INCREF(__pyx_v_buffers);
  __Pyx_GIVEREF(__pyx_v_buffers);
  PyTuple_SET_ITEM(__pyx_t_9, 4, __pyx_v_buffers);
  __Pyx_INCREF(__pyx_v_children);
  __Pyx_GIVEREF(__pyx_v_children);
  PyTuple_SET_ITEM(__pyx_t_9, 5, __pyx_v_children);
  __pyx_t_1 = 0;
  __pyx_t_5 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_r = __pyx_t_9;
  __pyx_t_9 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":276
 * 
 * 
 * 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":299
 * 
 * 
 * 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;
  PyObject *__pyx_v_buffers = NULL;
  PyObject *__pyx_v_children = 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)(PyObject *);
  int64_t __pyx_t_9;
  int64_t __pyx_t_10;
  int64_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  Py_ssize_t __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  __Pyx_RefNannySetupContext("_reconstruct_array_data", 0);

  /* "pyarrow/array.pxi":311
 *         vector[shared_ptr[CArrayData]] c_children
 * 
 *     dtype, length, null_count, offset, buffers, children = 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 != 6)) {
      if (size > 6) __Pyx_RaiseTooManyValuesError(6);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(2, 311, __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); 
    } 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_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);
    #else
    {
      Py_ssize_t i;
      PyObject** temps[6] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6};
      for (i=0; i < 6; i++) {
        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(2, 311, __pyx_L1_error)
        __Pyx_GOTREF(item);
        *(temps[i]) = item;
      }
    }
    #endif
  } else {
    Py_ssize_t index = -1;
    PyObject** temps[6] = {&__pyx_t_1,&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5,&__pyx_t_6};
    __pyx_t_7 = PyObject_GetIter(__pyx_v_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
    for (index=0; index < 6; index++) {
      PyObject* item = __pyx_t_8(__pyx_t_7); if (unlikely(!item)) goto __pyx_L3_unpacking_failed;
      __Pyx_GOTREF(item);
      *(temps[index]) = item;
    }
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 6) < 0) __PYX_ERR(2, 311, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(2, 311, __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(2, 311, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_10 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_11 = __Pyx_PyInt_As_int64_t(__pyx_t_4); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 311, __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_9;
  __pyx_v_null_count = __pyx_t_10;
  __pyx_v_offset = __pyx_t_11;
  __pyx_v_buffers = __pyx_t_5;
  __pyx_t_5 = 0;
  __pyx_v_children = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "pyarrow/array.pxi":313
 *     dtype, length, null_count, offset, buffers, children = data
 * 
 *     for i in range(len(buffers)):             # <<<<<<<<<<<<<<
 *         buf = buffers[i]
 *         if buf is None:
 */
  __pyx_t_12 = PyObject_Length(__pyx_v_buffers); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(2, 313, __pyx_L1_error)
  __pyx_t_13 = __pyx_t_12;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_13; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "pyarrow/array.pxi":314
 * 
 *     for i in range(len(buffers)):
 *         buf = buffers[i]             # <<<<<<<<<<<<<<
 *         if buf is None:
 *             c_buffers.push_back(shared_ptr[CBuffer]())
 */
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_buffers, __pyx_v_i, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(2, 314, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_buf, ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "pyarrow/array.pxi":315
 *     for i in range(len(buffers)):
 *         buf = buffers[i]
 *         if buf is None:             # <<<<<<<<<<<<<<
 *             c_buffers.push_back(shared_ptr[CBuffer]())
 *         else:
 */
    __pyx_t_14 = (((PyObject *)__pyx_v_buf) == Py_None);
    __pyx_t_15 = (__pyx_t_14 != 0);
    if (__pyx_t_15) {

      /* "pyarrow/array.pxi":316
 *         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(2, 316, __pyx_L1_error)
      }

      /* "pyarrow/array.pxi":315
 *     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":318
 *             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(2, 318, __pyx_L1_error)
      }
    }
    __pyx_L7:;
  }

  /* "pyarrow/array.pxi":320
 *             c_buffers.push_back(buf.buffer)
 * 
 *     for i in range(len(children)):             # <<<<<<<<<<<<<<
 *         c_children.push_back(_reconstruct_array_data(children[i]))
 * 
 */
  __pyx_t_12 = PyObject_Length(__pyx_v_children); if (unlikely(__pyx_t_12 == ((Py_ssize_t)-1))) __PYX_ERR(2, 320, __pyx_L1_error)
  __pyx_t_13 = __pyx_t_12;
  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_13; __pyx_t_11+=1) {
    __pyx_v_i = __pyx_t_11;

    /* "pyarrow/array.pxi":321
 * 
 *     for i in range(len(children)):
 *         c_children.push_back(_reconstruct_array_data(children[i]))             # <<<<<<<<<<<<<<
 * 
 *     return CArrayData.MakeWithChildren(
 */
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_children, __pyx_v_i, int64_t, 1, __Pyx_PyInt_From_int64_t, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    try {
      __pyx_v_c_children.push_back(__pyx_f_7pyarrow_3lib__reconstruct_array_data(__pyx_t_6));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(2, 321, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "pyarrow/array.pxi":323
 *         c_children.push_back(_reconstruct_array_data(children[i]))
 * 
 *     return CArrayData.MakeWithChildren(             # <<<<<<<<<<<<<<
 *         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_null_count, __pyx_v_offset);
  goto __pyx_L0;

  /* "pyarrow/array.pxi":299
 * 
 * 
 * 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_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_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":332
 * 
 * 
 * def _restore_array(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct an Array from pickled ArrayData.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_91_restore_array(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
static char __pyx_doc_7pyarrow_3lib_90_restore_array[] = "_restore_array(data)\n\n    Reconstruct an Array from pickled ArrayData.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_91_restore_array = {"_restore_array", (PyCFunction)__pyx_pw_7pyarrow_3lib_91_restore_array, METH_O, __pyx_doc_7pyarrow_3lib_90_restore_array};
static PyObject *__pyx_pw_7pyarrow_3lib_91_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_90_restore_array(__pyx_self, ((PyObject *)__pyx_v_data));

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

static PyObject *__pyx_pf_7pyarrow_3lib_90_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":336
 *     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":337
 *     """
 *     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(2, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":332
 * 
 * 
 * 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":342
 * cdef class Array:
 * 
 *     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":345
 *         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):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Do_not_call_s_constructor_direct_5, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 345, __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(2, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 345, __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(2, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/array.pxi":343
 * 
 *     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(2, 343, __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(2, 343, __pyx_L1_error)

  /* "pyarrow/array.pxi":342
 * cdef class Array:
 * 
 *     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":347
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         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":348
 * 
 *     cdef void init(self, const shared_ptr[CArray]& sp_array):
 *         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":349
 *     cdef void init(self, const shared_ptr[CArray]& sp_array):
 *         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":350
 *         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(2, 350, __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(2, 350, __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":347
 *                         .format(self.__class__.__name__))
 * 
 *     cdef void init(self, const shared_ptr[CArray]& sp_array):             # <<<<<<<<<<<<<<
 *         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_WriteUnraisable("pyarrow.lib.Array.init", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/array.pxi":352
 *         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":353
 * 
 *     def __eq__(self, other):
 *         raise NotImplementedError('Comparisons with pyarrow.Array are not '             # <<<<<<<<<<<<<<
 *                                   'implemented')
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 353, __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, 353, __pyx_L1_error)

  /* "pyarrow/array.pxi":352
 *         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":356
 *                                   '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":357
 * 
 *     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":358
 *     def _debug_print(self):
 *         with nogil:
 *             check_status(DebugPrint(deref(self.ap), 0))             # <<<<<<<<<<<<<<
 * 
 *     def cast(self, object target_type, bint safe=True):
 */
        __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(2, 358, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":357
 * 
 *     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":356
 *                                   '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":360
 *             check_status(DebugPrint(deref(self.ap), 0))
 * 
 *     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_7cast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_6cast[] = "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_7cast(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(2, 360, __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(2, 360, __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(2, 360, __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_6cast(((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_6cast(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":408
 *         """
 *         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":409
 *         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)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 409, __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":412
 *             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":413
 * 
 *         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(2, 413, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":412
 *             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":416
 *                               options, &result))
 * 
 *         return pyarrow_wrap_array(result)             # <<<<<<<<<<<<<<
 * 
 *     def unique(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(2, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":360
 *             check_status(DebugPrint(deref(self.ap), 0))
 * 
 *     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":418
 *         return pyarrow_wrap_array(result)
 * 
 *     def unique(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute distinct elements in array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_9unique(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_8unique[] = "Array.unique(self)\n\n        Compute distinct elements in array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_9unique(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_8unique(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_8unique(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":424
 *         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":425
 * 
 *         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(2, 425, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":424
 *         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":427
 *             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(2, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":418
 *         return pyarrow_wrap_array(result)
 * 
 *     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":429
 *         return pyarrow_wrap_array(result)
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute dictionary-encoded representation of array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_11dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_10dictionary_encode[] = "Array.dictionary_encode(self)\n\n        Compute dictionary-encoded representation of array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_11dictionary_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_10dictionary_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_10dictionary_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":435
 *         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":436
 * 
 *         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(2, 436, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":435
 *         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":439
 *                                           &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(2, 439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":429
 *         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":442
 * 
 *     @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_13from_pandas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_12from_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, Inded Series\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_13from_pandas = {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_13from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_12from_pandas};
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_13from_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":443
 *     @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(2, 442, __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(2, 442, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":442
 * 
 *     @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(2, 442, __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(2, 443, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_12from_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_12from_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":474
 *         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(2, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 474, __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(2, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_mask, __pyx_v_mask) < 0) __PYX_ERR(2, 474, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_type, __pyx_v_type) < 0) __PYX_ERR(2, 474, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_safe); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_safe, __pyx_t_4) < 0) __PYX_ERR(2, 474, __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(2, 474, __pyx_L1_error)

  /* "pyarrow/array.pxi":475
 *         """
 *         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(2, 474, __pyx_L1_error)

  /* "pyarrow/array.pxi":474
 *         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(2, 474, __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":442
 * 
 *     @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":477
 *                      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_15__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_14__reduce__[] = "Array.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_15__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_14__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_14__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":478
 * 
 *     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(2, 478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/array.pxi":479
 *     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(2, 479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 479, __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":478
 * 
 *     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(2, 478, __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":477
 *                      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":482
 * 
 *     @staticmethod
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0):             # <<<<<<<<<<<<<<
 *         """
 *         Construct an Array from a sequence of buffers.  The concrete type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_17from_buffers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_16from_buffers[] = "Array.from_buffers(DataType type, length, buffers, null_count=-1, offset=0)\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\n        Returns\n        -------\n        array : Array\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_5Array_17from_buffers = {"from_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_17from_buffers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_16from_buffers};
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_17from_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_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,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[3] = ((PyObject *)__pyx_int_neg_1);
    values[4] = ((PyObject *)__pyx_int_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  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, 5, 1); __PYX_ERR(2, 482, __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, 5, 2); __PYX_ERR(2, 482, __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--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_buffers") < 0)) __PYX_ERR(2, 482, __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_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];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_buffers", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 482, __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(2, 482, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_16from_buffers(__pyx_v_type, __pyx_v_length, __pyx_v_buffers, __pyx_v_null_count, __pyx_v_offset);

  /* 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_16from_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) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_buf = 0;
  std::vector<std::shared_ptr< arrow::Buffer> >  __pyx_v_c_buffers;
  std::shared_ptr< arrow::ArrayData>  __pyx_v_ad;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  enum  arrow::Type::type __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  int64_t __pyx_t_7;
  int64_t __pyx_t_8;
  int64_t __pyx_t_9;
  __Pyx_RefNannySetupContext("from_buffers", 0);

  /* "pyarrow/array.pxi":509
 *             shared_ptr[CArrayData] ad
 * 
 *         if not is_primitive(type.id):             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("from_buffers is only supported for "
 *                                       "primitive arrays yet.")
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_type), __pyx_n_s_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((enum  arrow::Type::type)__Pyx_PyInt_As_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 509, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!(arrow::is_primitive(__pyx_t_2) != 0)) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/array.pxi":510
 * 
 *         if not is_primitive(type.id):
 *             raise NotImplementedError("from_buffers is only supported for "             # <<<<<<<<<<<<<<
 *                                       "primitive arrays yet.")
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 510, __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, 510, __pyx_L1_error)

    /* "pyarrow/array.pxi":509
 *             shared_ptr[CArrayData] ad
 * 
 *         if not is_primitive(type.id):             # <<<<<<<<<<<<<<
 *             raise NotImplementedError("from_buffers is only supported for "
 *                                       "primitive arrays yet.")
 */
  }

  /* "pyarrow/array.pxi":513
 *                                       "primitive arrays yet.")
 * 
 *         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_1 = __pyx_v_buffers; __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_buffers); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 513, __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(2, 513, __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_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(2, 513, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 513, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(2, 513, __pyx_L1_error)
        #else
        __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 513, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
      }
    } else {
      __pyx_t_6 = __pyx_t_5(__pyx_t_1);
      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(2, 513, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_6);
    }
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(2, 513, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_buf, ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "pyarrow/array.pxi":515
 *         for buf in buffers:
 *             # None will produce a null buffer pointer
 *             c_buffers.push_back(pyarrow_unwrap_buffer(buf))             # <<<<<<<<<<<<<<
 *         ad = CArrayData.Make(type.sp_type, length, c_buffers,
 *                              null_count, offset)
 */
    try {
      __pyx_v_c_buffers.push_back(__pyx_f_7pyarrow_3lib_pyarrow_unwrap_buffer(((PyObject *)__pyx_v_buf)));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(2, 515, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":513
 *                                       "primitive arrays yet.")
 * 
 *         for buf in buffers:             # <<<<<<<<<<<<<<
 *             # None will produce a null buffer pointer
 *             c_buffers.push_back(pyarrow_unwrap_buffer(buf))
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":516
 *             # None will produce a null buffer pointer
 *             c_buffers.push_back(pyarrow_unwrap_buffer(buf))
 *         ad = CArrayData.Make(type.sp_type, length, c_buffers,             # <<<<<<<<<<<<<<
 *                              null_count, offset)
 *         return pyarrow_wrap_array(MakeArray(ad))
 */
  __pyx_t_7 = __Pyx_PyInt_As_int64_t(__pyx_v_length); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 516, __pyx_L1_error)

  /* "pyarrow/array.pxi":517
 *             c_buffers.push_back(pyarrow_unwrap_buffer(buf))
 *         ad = CArrayData.Make(type.sp_type, length, c_buffers,
 *                              null_count, offset)             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(MakeArray(ad))
 * 
 */
  __pyx_t_8 = __Pyx_PyInt_As_int64_t(__pyx_v_null_count); if (unlikely((__pyx_t_8 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 517, __pyx_L1_error)
  __pyx_t_9 = __Pyx_PyInt_As_int64_t(__pyx_v_offset); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(2, 517, __pyx_L1_error)

  /* "pyarrow/array.pxi":516
 *             # None will produce a null buffer pointer
 *             c_buffers.push_back(pyarrow_unwrap_buffer(buf))
 *         ad = CArrayData.Make(type.sp_type, length, c_buffers,             # <<<<<<<<<<<<<<
 *                              null_count, offset)
 *         return pyarrow_wrap_array(MakeArray(ad))
 */
  __pyx_v_ad =  arrow::ArrayData::Make(__pyx_v_type->sp_type, __pyx_t_7, __pyx_v_c_buffers, __pyx_t_8, __pyx_t_9);

  /* "pyarrow/array.pxi":518
 *         ad = CArrayData.Make(type.sp_type, length, c_buffers,
 *                              null_count, offset)
 *         return pyarrow_wrap_array(MakeArray(ad))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __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(2, 518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":482
 * 
 *     @staticmethod
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0):             # <<<<<<<<<<<<<<
 *         """
 *         Construct an Array from a sequence of buffers.  The concrete type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":521
 * 
 *     @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":522
 *     @property
 *     def null_count(self):
 *         return self.sp_array.get().null_count()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __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(2, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":521
 * 
 *     @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;
}
static PyObject *__pyx_gb_7pyarrow_3lib_5Array_20generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/array.pxi":524
 *         return self.sp_array.get().null_count()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for i in range(len(self)):
 *             yield self.getitem(i)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_19__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_19__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_18__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_18__iter__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___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_4___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_4___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_4___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(2, 524, __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_20generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_Array___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(2, 524, __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_20generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___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(2, 524, __pyx_L1_error)

  /* "pyarrow/array.pxi":525
 * 
 *     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(2, 525, __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":526
 *     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(2, 526, __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(2, 526, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/array.pxi":524
 *         return self.sp_array.get().null_count()
 * 
 *     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":528
 *             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_22__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_22__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_21__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_21__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":529
 * 
 *     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(2, 529, __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(2, 529, __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":530
 *     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_s_0_1, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 530, __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(2, 530, __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(2, 530, __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(2, 530, __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(2, 530, __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":528
 *             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":532
 *         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_24format(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_23format[] = "Array.format(self, int indent=0, int window=10)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_24format(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(2, 532, __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(2, 532, __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(2, 532, __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(2, 532, __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_23format(((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_23format(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":536
 *             c_string result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 PrettyPrint(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":537
 * 
 *         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(2, 537, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":536
 *             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":545
 *             )
 * 
 *         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(2, 545, __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(2, 545, __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, 545, __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":532
 *         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":547
 *         return frombytes(result)
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         return self.format()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_26__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_26__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_25__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_25__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":548
 * 
 *     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(2, 548, __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, 548, __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":547
 *         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":550
 *         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_28equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_27equals[] = "Array.equals(self, Array other)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_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_Array, 1, "other", 0))) __PYX_ERR(2, 550, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_27equals(((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_27equals(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":551
 * 
 *     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(2, 551, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":550
 *         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":553
 *         return self.ap.Equals(deref(other.ap))
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_5Array_30__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_5Array_30__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_29__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_29__len__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "pyarrow/array.pxi":554
 * 
 *     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":553
 *         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":556
 *         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":557
 * 
 *     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":558
 *     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":557
 * 
 *     cdef int64_t length(self):
 *         if self.sp_array.get():             # <<<<<<<<<<<<<<
 *             return self.sp_array.get().length()
 *         else:
 */
  }

  /* "pyarrow/array.pxi":560
 *             return self.sp_array.get().length()
 *         else:
 *             return 0             # <<<<<<<<<<<<<<
 * 
 *     def isnull(self):
 */
  /*else*/ {
    __pyx_r = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/array.pxi":556
 *         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":562
 *             return 0
 * 
 *     def isnull(self):             # <<<<<<<<<<<<<<
 *         raise NotImplemented
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_32isnull(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_31isnull[] = "Array.isnull(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_32isnull(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_31isnull(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_31isnull(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isnull", 0);

  /* "pyarrow/array.pxi":563
 * 
 *     def isnull(self):
 *         raise NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __Pyx_Raise(__pyx_builtin_NotImplemented, 0, 0, 0);
  __PYX_ERR(2, 563, __pyx_L1_error)

  /* "pyarrow/array.pxi":562
 *             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":565
 *         raise NotImplemented
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if PySlice_Check(key):
 *             return _normalize_slice(self, key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_34__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_34__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_5Array_33__getitem__(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_33__getitem__(struct __pyx_obj_7pyarrow_3lib_Array *__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;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/array.pxi":566
 * 
 *     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/array.pxi":567
 *     def __getitem__(self, key):
 *         if PySlice_Check(key):
 *             return _normalize_slice(self, key)             # <<<<<<<<<<<<<<
 * 
 *         return self.getitem(_normalize_index(key, self.length()))
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_normalize_slice); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 567, __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(2, 567, __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(2, 567, __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(2, 567, __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(2, 567, __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":566
 * 
 *     def __getitem__(self, key):
 *         if PySlice_Check(key):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 * 
 */
  }

  /* "pyarrow/array.pxi":569
 *             return _normalize_slice(self, key)
 * 
 *         return self.getitem(_normalize_index(key, self.length()))             # <<<<<<<<<<<<<<
 * 
 *     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(2, 569, __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(2, 569, __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(2, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":565
 *         raise NotImplemented
 * 
 *     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.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":571
 *         return self.getitem(_normalize_index(key, 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":572
 * 
 *     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(2, 572, __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":571
 *         return self.getitem(_normalize_index(key, 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":574
 *         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_36slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_35slice[] = "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_36slice(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(2, 574, __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(2, 574, __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_35slice(((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_35slice(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":593
 *             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(2, 593, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 593, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":594
 * 
 *         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__83, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 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(2, 594, __pyx_L1_error)

    /* "pyarrow/array.pxi":593
 *             shared_ptr[CArray] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/array.pxi":596
 *             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":597
 * 
 *         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(2, 597, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->ap->Slice(__pyx_t_4);

    /* "pyarrow/array.pxi":596
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.ap.Slice(offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/array.pxi":599
 *             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(2, 599, __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(2, 599, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->ap->Slice(__pyx_t_4, __pyx_t_5);
  }
  __pyx_L4:;

  /* "pyarrow/array.pxi":601
 *             result = self.ap.Slice(offset, length)
 * 
 *         return pyarrow_wrap_array(result)             # <<<<<<<<<<<<<<
 * 
 *     def to_pandas(self, bint strings_to_categorical=False,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":574
 *         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":603
 *         return pyarrow_wrap_array(result)
 * 
 *     def to_pandas(self, bint strings_to_categorical=False,             # <<<<<<<<<<<<<<
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,
 *                   bint date_as_object=False):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_38to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_37to_pandas[] = "Array.to_pandas(self, bool strings_to_categorical=False, bool zero_copy_only=False, bool integer_object_nulls=False, bool date_as_object=False)\n\n        Convert to a NumPy array object suitable for use in pandas.\n\n        Parameters\n        ----------\n        strings_to_categorical : boolean, default False\n            Encode string (UTF8) and binary types to pandas.Categorical\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\n        See also\n        --------\n        Column.to_pandas\n        Table.to_pandas\n        RecordBatch.to_pandas\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_38to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_strings_to_categorical;
  int __pyx_v_zero_copy_only;
  int __pyx_v_integer_object_nulls;
  int __pyx_v_date_as_object;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_strings_to_categorical,&__pyx_n_s_zero_copy_only,&__pyx_n_s_integer_object_nulls,&__pyx_n_s_date_as_object,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 (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strings_to_categorical);
          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_zero_copy_only);
          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_integer_object_nulls);
          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_date_as_object);
          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(2, 603, __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);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_strings_to_categorical = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_strings_to_categorical == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 603, __pyx_L3_error)
    } else {
      __pyx_v_strings_to_categorical = ((int)0);
    }
    if (values[1]) {
      __pyx_v_zero_copy_only = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_zero_copy_only == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 604, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":604
 * 
 *     def to_pandas(self, bint strings_to_categorical=False,
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,             # <<<<<<<<<<<<<<
 *                   bint date_as_object=False):
 *         """
 */
      __pyx_v_zero_copy_only = ((int)0);
    }
    if (values[2]) {
      __pyx_v_integer_object_nulls = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_integer_object_nulls == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 604, __pyx_L3_error)
    } else {
      __pyx_v_integer_object_nulls = ((int)0);
    }
    if (values[3]) {
      __pyx_v_date_as_object = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_date_as_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 605, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":605
 *     def to_pandas(self, bint strings_to_categorical=False,
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,
 *                   bint date_as_object=False):             # <<<<<<<<<<<<<<
 *         """
 *         Convert to a NumPy array object suitable for use in pandas.
 */
      __pyx_v_date_as_object = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_pandas", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 603, __pyx_L3_error)
  __pyx_L3_error:;
  __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_37to_pandas(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self), __pyx_v_strings_to_categorical, __pyx_v_zero_copy_only, __pyx_v_integer_object_nulls, __pyx_v_date_as_object);

  /* "pyarrow/array.pxi":603
 *         return pyarrow_wrap_array(result)
 * 
 *     def to_pandas(self, bint strings_to_categorical=False,             # <<<<<<<<<<<<<<
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,
 *                   bint date_as_object=False):
 */

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_37to_pandas(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, int __pyx_v_strings_to_categorical, int __pyx_v_zero_copy_only, int __pyx_v_integer_object_nulls, int __pyx_v_date_as_object) {
  PyObject *__pyx_v_out;
  struct arrow::py::PandasOptions __pyx_v_options;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct arrow::py::PandasOptions __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("to_pandas", 0);

  /* "pyarrow/array.pxi":632
 * 
 *         options = PandasOptions(
 *             strings_to_categorical=strings_to_categorical,             # <<<<<<<<<<<<<<
 *             zero_copy_only=zero_copy_only,
 *             integer_object_nulls=integer_object_nulls,
 */
  __pyx_t_1.strings_to_categorical = __pyx_v_strings_to_categorical;

  /* "pyarrow/array.pxi":633
 *         options = PandasOptions(
 *             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_1.zero_copy_only = __pyx_v_zero_copy_only;

  /* "pyarrow/array.pxi":634
 *             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=False)
 */
  __pyx_t_1.integer_object_nulls = __pyx_v_integer_object_nulls;

  /* "pyarrow/array.pxi":635
 *             zero_copy_only=zero_copy_only,
 *             integer_object_nulls=integer_object_nulls,
 *             date_as_object=date_as_object,             # <<<<<<<<<<<<<<
 *             use_threads=False)
 *         with nogil:
 */
  __pyx_t_1.date_as_object = __pyx_v_date_as_object;

  /* "pyarrow/array.pxi":636
 *             integer_object_nulls=integer_object_nulls,
 *             date_as_object=date_as_object,
 *             use_threads=False)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(ConvertArrayToPandas(options, self.sp_array,
 */
  __pyx_t_1.use_threads = 0;
  __pyx_v_options = __pyx_t_1;

  /* "pyarrow/array.pxi":637
 *             date_as_object=date_as_object,
 *             use_threads=False)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ConvertArrayToPandas(options, self.sp_array,
 *                                               self, &out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":638
 *             use_threads=False)
 *         with nogil:
 *             check_status(ConvertArrayToPandas(options, self.sp_array,             # <<<<<<<<<<<<<<
 *                                               self, &out))
 *         return wrap_array_output(out)
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::ConvertArrayToPandas(__pyx_v_options, __pyx_v_self->sp_array, ((PyObject *)__pyx_v_self), (&__pyx_v_out))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 638, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":637
 *             date_as_object=date_as_object,
 *             use_threads=False)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ConvertArrayToPandas(options, self.sp_array,
 *                                               self, &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":640
 *             check_status(ConvertArrayToPandas(options, self.sp_array,
 *                                               self, &out))
 *         return wrap_array_output(out)             # <<<<<<<<<<<<<<
 * 
 *     def __array__(self, dtype=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_wrap_array_output(__pyx_v_out); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":603
 *         return pyarrow_wrap_array(result)
 * 
 *     def to_pandas(self, bint strings_to_categorical=False,             # <<<<<<<<<<<<<<
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,
 *                   bint date_as_object=False):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __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":642
 *         return wrap_array_output(out)
 * 
 *     def __array__(self, dtype=None):             # <<<<<<<<<<<<<<
 *         if dtype is None:
 *             return self.to_pandas()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_40__array__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_39__array__[] = "Array.__array__(self, dtype=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_40__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(2, 642, __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(2, 642, __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_39__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_39__array__(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self, PyObject *__pyx_v_dtype) {
  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("__array__", 0);

  /* "pyarrow/array.pxi":643
 * 
 *     def __array__(self, dtype=None):
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             return self.to_pandas()
 *         return self.to_pandas().astype(dtype)
 */
  __pyx_t_1 = (__pyx_v_dtype == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":644
 *     def __array__(self, dtype=None):
 *         if dtype is None:
 *             return self.to_pandas()             # <<<<<<<<<<<<<<
 *         return self.to_pandas().astype(dtype)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_pandas); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 644, __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(2, 644, __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/array.pxi":643
 * 
 *     def __array__(self, dtype=None):
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             return self.to_pandas()
 *         return self.to_pandas().astype(dtype)
 */
  }

  /* "pyarrow/array.pxi":645
 *         if dtype is None:
 *             return self.to_pandas()
 *         return self.to_pandas().astype(dtype)             # <<<<<<<<<<<<<<
 * 
 *     def to_numpy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_pandas); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 645, __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(2, 645, __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_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 645, __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 && likely(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, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_dtype);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":642
 *         return wrap_array_output(out)
 * 
 *     def __array__(self, dtype=None):             # <<<<<<<<<<<<<<
 *         if dtype is None:
 *             return self.to_pandas()
 */

  /* 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.Array.__array__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":647
 *         return self.to_pandas().astype(dtype)
 * 
 *     def to_numpy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Experimental: return a NumPy view of this array. Only primitive
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_42to_numpy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_41to_numpy[] = "Array.to_numpy(self)\n\n        Experimental: return a NumPy view of this array. Only primitive\n        arrays with the same memory layout as NumPy (i.e. integers,\n        floating point), without any nulls, are supported.\n\n        Returns\n        -------\n        array : numpy.ndarray\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_42to_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_5Array_41to_numpy(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_41to_numpy(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_v_buflist = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  enum  arrow::Type::type __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("to_numpy", 0);

  /* "pyarrow/array.pxi":657
 *         array : numpy.ndarray
 *         """
 *         if self.null_count:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError('NumPy array view is only supported '
 *                                       'for arrays without nulls.')
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_null_count); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 657, __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, 657, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":658
 *         """
 *         if self.null_count:
 *             raise NotImplementedError('NumPy array view is only supported '             # <<<<<<<<<<<<<<
 *                                       'for arrays without nulls.')
 *         if not is_primitive(self.type.id) or self.type.id == _Type_BOOL:
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 658, __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, 658, __pyx_L1_error)

    /* "pyarrow/array.pxi":657
 *         array : numpy.ndarray
 *         """
 *         if self.null_count:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError('NumPy array view is only supported '
 *                                       'for arrays without nulls.')
 */
  }

  /* "pyarrow/array.pxi":660
 *             raise NotImplementedError('NumPy array view is only supported '
 *                                       'for arrays without nulls.')
 *         if not is_primitive(self.type.id) or self.type.id == _Type_BOOL:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError('NumPy array view is only supported '
 *                                       'for primitive types.')
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->type), __pyx_n_s_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = ((enum  arrow::Type::type)__Pyx_PyInt_As_enum____arrow_3a__3a_Type_3a__3a_type(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = ((!(arrow::is_primitive(__pyx_t_3) != 0)) != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->type), __pyx_n_s_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 660, __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(2, 660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_2 = __pyx_t_4;
  __pyx_L5_bool_binop_done:;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":661
 *                                       'for arrays without nulls.')
 *         if not is_primitive(self.type.id) or self.type.id == _Type_BOOL:
 *             raise NotImplementedError('NumPy array view is only supported '             # <<<<<<<<<<<<<<
 *                                       'for primitive types.')
 *         buflist = self.buffers()
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 661, __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(2, 661, __pyx_L1_error)

    /* "pyarrow/array.pxi":660
 *             raise NotImplementedError('NumPy array view is only supported '
 *                                       'for arrays without nulls.')
 *         if not is_primitive(self.type.id) or self.type.id == _Type_BOOL:             # <<<<<<<<<<<<<<
 *             raise NotImplementedError('NumPy array view is only supported '
 *                                       'for primitive types.')
 */
  }

  /* "pyarrow/array.pxi":663
 *             raise NotImplementedError('NumPy array view is only supported '
 *                                       'for primitive types.')
 *         buflist = self.buffers()             # <<<<<<<<<<<<<<
 *         assert len(buflist) == 2
 *         return np.frombuffer(buflist[-1], dtype=self.type.to_pandas_dtype())[
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_buffers); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 663, __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_6 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_buflist = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "pyarrow/array.pxi":664
 *                                       'for primitive types.')
 *         buflist = self.buffers()
 *         assert len(buflist) == 2             # <<<<<<<<<<<<<<
 *         return np.frombuffer(buflist[-1], dtype=self.type.to_pandas_dtype())[
 *             self.offset:self.offset + len(self)]
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_7 = PyObject_Length(__pyx_v_buflist); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(2, 664, __pyx_L1_error)
    if (unlikely(!((__pyx_t_7 == 2) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(2, 664, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/array.pxi":665
 *         buflist = self.buffers()
 *         assert len(buflist) == 2
 *         return np.frombuffer(buflist[-1], dtype=self.type.to_pandas_dtype())[             # <<<<<<<<<<<<<<
 *             self.offset:self.offset + len(self)]
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_frombuffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_buflist, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 665, __pyx_L1_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;
  __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->type), __pyx_n_s_to_pandas_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 665, __pyx_L1_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_CallOneArg(__pyx_t_9, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(2, 665, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 665, __pyx_L1_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;

  /* "pyarrow/array.pxi":666
 *         assert len(buflist) == 2
 *         return np.frombuffer(buflist[-1], dtype=self.type.to_pandas_dtype())[
 *             self.offset:self.offset + len(self)]             # <<<<<<<<<<<<<<
 * 
 *     def to_pylist(self):
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_offset); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_offset); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(2, 666, __pyx_L1_error)
  __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_9 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 666, __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;

  /* "pyarrow/array.pxi":665
 *         buflist = self.buffers()
 *         assert len(buflist) == 2
 *         return np.frombuffer(buflist[-1], dtype=self.type.to_pandas_dtype())[             # <<<<<<<<<<<<<<
 *             self.offset:self.offset + len(self)]
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_8, 0, 0, &__pyx_t_6, &__pyx_t_9, NULL, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 665, __pyx_L1_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(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":647
 *         return self.to_pandas().astype(dtype)
 * 
 *     def to_numpy(self):             # <<<<<<<<<<<<<<
 *         """
 *         Experimental: return a NumPy view of this array. Only primitive
 */

  /* 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_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_buflist);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":668
 *             self.offset:self.offset + len(self)]
 * 
 *     def to_pylist(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert to a list of native Python objects.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_44to_pylist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_43to_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_44to_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_43to_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_43to_pylist(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__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":676
 *         lst : list
 *         """
 *         return [x.as_py() for x in self]             # <<<<<<<<<<<<<<
 * 
 *     def validate(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 676, __pyx_L1_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(2, 676, __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(2, 676, __pyx_L1_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(2, 676, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 676, __pyx_L1_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(2, 676, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 676, __pyx_L1_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(2, 676, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_as_py); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 676, __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(2, 676, __pyx_L1_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(2, 676, __pyx_L1_error)
    __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/array.pxi":668
 *             self.offset:self.offset + len(self)]
 * 
 *     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_v_x);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":678
 *         return [x.as_py() for x in self]
 * 
 *     def validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Perform any validation checks implemented by
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_46validate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_45validate[] = "Array.validate(self)\n\n        Perform any validation checks implemented by\n        arrow::ValidateArray. Raises exception with error message if array does\n        not validate\n\n        Raises\n        ------\n        ArrowInvalid\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Array_46validate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("validate (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Array_45validate(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_45validate(struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("validate", 0);

  /* "pyarrow/array.pxi":688
 *         ArrowInvalid
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ValidateArray(deref(self.ap)))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":689
 *         """
 *         with nogil:
 *             check_status(ValidateArray(deref(self.ap)))             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::ValidateArray((*__pyx_v_self->ap))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 689, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":688
 *         ArrowInvalid
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ValidateArray(deref(self.ap)))
 * 
 */
      /*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":678
 *         return [x.as_py() for x in self]
 * 
 *     def validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Perform any validation checks implemented by
 */

  /* 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":692
 * 
 *     @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":698
 *         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(2, 698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":692
 * 
 *     @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":700
 *         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_48buffers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Array_47buffers[] = "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_48buffers(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_47buffers(((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Array_47buffers(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":708
 *         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(2, 708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_res = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":709
 *         """
 *         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(2, 709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":710
 *         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":700
 *         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":177
 * 
 *     cdef readonly:
 *         DataType type             # <<<<<<<<<<<<<<
 * 
 *     cdef void init(self, const shared_ptr[CArray]& sp_array)
 */

/* 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/array.pxi":715
 * cdef class Tensor:
 * 
 *     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/array.pxi":716
 * 
 *     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__86, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 716, __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, 716, __pyx_L1_error)

  /* "pyarrow/array.pxi":715
 * cdef class Tensor:
 * 
 *     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/array.pxi":719
 *                         "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/array.pxi":720
 * 
 *     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/array.pxi":721
 *     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/array.pxi":722
 *         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(2, 722, __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(2, 722, __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":719
 *                         "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/array.pxi":724
 *         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/array.pxi":725
 * 
 *     def __repr__(self):
 *         return """<pyarrow.Tensor>             # <<<<<<<<<<<<<<
 * type: {0.type}
 * shape: {0.shape}
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/array.pxi":728
 * type: {0.type}
 * shape: {0.shape}
 * strides: {0.strides}""".format(self)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_pyarrow_Tensor_type_0_type_shap, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 728, __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(2, 728, __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":724
 *         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/array.pxi":731
 * 
 *     @staticmethod
 *     def from_numpy(obj):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CTensor] ctensor
 *         with nogil:
 */

/* 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)";
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_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_numpy (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_numpy") < 0)) __PYX_ERR(2, 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_obj = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_numpy", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 731, __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);

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Tensor_4from_numpy(PyObject *__pyx_v_obj) {
  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_numpy", 0);

  /* "pyarrow/array.pxi":733
 *     def from_numpy(obj):
 *         cdef shared_ptr[CTensor] ctensor
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(NdarrayToTensor(c_default_memory_pool(), obj,
 *                                          &ctensor))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":734
 *         cdef shared_ptr[CTensor] ctensor
 *         with nogil:
 *             check_status(NdarrayToTensor(c_default_memory_pool(), obj,             # <<<<<<<<<<<<<<
 *                                          &ctensor))
 *         return pyarrow_wrap_tensor(ctensor)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::NdarrayToTensor( arrow::default_memory_pool(), __pyx_v_obj, (&__pyx_v_ctensor))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 734, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":733
 *     def from_numpy(obj):
 *         cdef shared_ptr[CTensor] ctensor
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(NdarrayToTensor(c_default_memory_pool(), obj,
 *                                          &ctensor))
 */
      /*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":736
 *             check_status(NdarrayToTensor(c_default_memory_pool(), obj,
 *                                          &ctensor))
 *         return pyarrow_wrap_tensor(ctensor)             # <<<<<<<<<<<<<<
 * 
 *     def to_numpy(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_tensor(__pyx_v_ctensor); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":731
 * 
 *     @staticmethod
 *     def from_numpy(obj):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CTensor] ctensor
 *         with nogil:
 */

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

/* "pyarrow/array.pxi":738
 *         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/array.pxi":744
 *         cdef PyObject* out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(TensorToNdarray(self.sp_tensor, self, &out))
 *         return PyObject_to_object(out)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":745
 * 
 *         with nogil:
 *             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(2, 745, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":744
 *         cdef PyObject* out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(TensorToNdarray(self.sp_tensor, self, &out))
 *         return PyObject_to_object(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":746
 *         with nogil:
 *             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(2, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":738
 *         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/array.pxi":748
 *         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(2, 748, __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/array.pxi":752
 *         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(2, 752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":748
 *         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/array.pxi":754
 *         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/array.pxi":755
 * 
 *     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/array.pxi":756
 *     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(2, 756, __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(2, 756, __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/array.pxi":755
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, Tensor):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  }

  /* "pyarrow/array.pxi":758
 *             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/array.pxi":754
 *         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/array.pxi":761
 * 
 *     @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/array.pxi":762
 *     @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(2, 762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":761
 * 
 *     @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/array.pxi":765
 * 
 *     @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/array.pxi":766
 *     @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(2, 766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":765
 * 
 *     @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/array.pxi":769
 * 
 *     @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/array.pxi":770
 *     @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(2, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":769
 * 
 *     @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/array.pxi":773
 * 
 *     @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/array.pxi":774
 *     @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(2, 774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":773
 * 
 *     @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/array.pxi":777
 * 
 *     @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/array.pxi":779
 *     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(2, 779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 779, __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":777
 * 
 *     @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/array.pxi":782
 * 
 *     @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/array.pxi":783
 *     @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(2, 783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 783, __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":782
 * 
 *     @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/array.pxi":785
 *         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_13__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_7pyarrow_3lib_6Tensor_13__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_12__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_12__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;
  PyObject *__pyx_t_4 = NULL;
  char *__pyx_t_5;
  Py_ssize_t __pyx_t_6;
  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/array.pxi":786
 * 
 *     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/array.pxi":787
 *     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/array.pxi":788
 *         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/array.pxi":790
 *         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_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 790, __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_t_4 = __Pyx_PyString_Format(__pyx_kp_s_type_s_not_supported_for_buffer, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":789
 *         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 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 789, __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(2, 789, __pyx_L1_error)

    /* "pyarrow/array.pxi":788
 *         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/array.pxi":791
 *             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(2, 791, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_PyBytes_AsWritableString(__pyx_v_pep3118_format); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) __PYX_ERR(2, 791, __pyx_L1_error)
  __pyx_v_buffer->format = __pyx_t_5;

  /* "pyarrow/array.pxi":792
 *                                       "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(2, 792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_FloorDivideObjC(__pyx_t_1, __pyx_int_8, 8, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 792, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_buffer->itemsize = __pyx_t_6;

  /* "pyarrow/array.pxi":793
 *         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/array.pxi":794
 *         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/array.pxi":795
 *         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/array.pxi":796
 *         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/array.pxi":797
 *         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/array.pxi":798
 *         buffer.obj = self
 *         if self.tp.is_mutable():
 *             buffer.readonly = 0             # <<<<<<<<<<<<<<
 *         else:
 *             buffer.readonly = 1
 */
    __pyx_v_buffer->readonly = 0;

    /* "pyarrow/array.pxi":797
 *         buffer.ndim = self.tp.ndim()
 *         buffer.obj = self
 *         if self.tp.is_mutable():             # <<<<<<<<<<<<<<
 *             buffer.readonly = 0
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/array.pxi":800
 *             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/array.pxi":803
 *         # 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/array.pxi":804
 *         # 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/array.pxi":805
 *         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/array.pxi":785
 *         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_4);
  __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":190
 * 
 *     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_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Tensor_14__reduce_cython__[] = "Tensor.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_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_6Tensor_14__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_14__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__87, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Tensor_16__setstate_cython__[] = "Tensor.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Tensor_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_6Tensor_16__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_16__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__88, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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/array.pxi":808
 * 
 * 
 * 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":809
 * 
 * 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(2, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_obj = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":811
 *     cdef object obj = PyObject_to_object(output)
 * 
 *     if isinstance(obj, dict):             # <<<<<<<<<<<<<<
 *         return Categorical(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":812
 * 
 *     if isinstance(obj, dict):
 *         return Categorical(obj['indices'],             # <<<<<<<<<<<<<<
 *                            categories=obj['dictionary'],
 *                            ordered=obj['ordered'], fastpath=True)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Categorical); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 812, __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":813
 *     if isinstance(obj, dict):
 *         return Categorical(obj['indices'],
 *                            categories=obj['dictionary'],             # <<<<<<<<<<<<<<
 *                            ordered=obj['ordered'], fastpath=True)
 *     else:
 */
    __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_dictionary); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 813, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_categories, __pyx_t_6) < 0) __PYX_ERR(2, 813, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/array.pxi":814
 *         return Categorical(obj['indices'],
 *                            categories=obj['dictionary'],
 *                            ordered=obj['ordered'], fastpath=True)             # <<<<<<<<<<<<<<
 *     else:
 *         return obj
 */
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_ordered); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 814, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_ordered, __pyx_t_6) < 0) __PYX_ERR(2, 813, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_fastpath, Py_True) < 0) __PYX_ERR(2, 813, __pyx_L1_error)

    /* "pyarrow/array.pxi":812
 * 
 *     if isinstance(obj, dict):
 *         return Categorical(obj['indices'],             # <<<<<<<<<<<<<<
 *                            categories=obj['dictionary'],
 *                            ordered=obj['ordered'], fastpath=True)
 */
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 812, __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":811
 *     cdef object obj = PyObject_to_object(output)
 * 
 *     if isinstance(obj, dict):             # <<<<<<<<<<<<<<
 *         return Categorical(obj['indices'],
 *                            categories=obj['dictionary'],
 */
  }

  /* "pyarrow/array.pxi":816
 *                            ordered=obj['ordered'], 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":808
 * 
 * 
 * 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":914
 * 
 *     @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        offset : 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(2, 914, __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(2, 914, __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(2, 914, __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(2, 914, __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;
  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":930
 *             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":932
 *         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(2, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 932, __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(2, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_type, __pyx_n_s_int32) < 0) __PYX_ERR(2, 932, __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(2, 932, __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(2, 932, __pyx_L1_error)
  __pyx_v__offsets = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":933
 * 
 *         _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(2, 933, __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(2, 933, __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(2, 933, __pyx_L1_error)
  __pyx_v__values = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":935
 *         _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":936
 * 
 *         with nogil:
 *             check_status(CListArray.FromArrays(_offsets.ap[0], _values.ap[0],             # <<<<<<<<<<<<<<
 *                                                cpool, &out))
 *         return 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(2, 936, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":935
 *         _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":938
 *             check_status(CListArray.FromArrays(_offsets.ap[0], _values.ap[0],
 *                                                cpool, &out))
 *         return pyarrow_wrap_array(out)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":914
 * 
 *     @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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":944
 * 
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children):             # <<<<<<<<<<<<<<
 *         """
 *         Construct dense UnionArray from arrays of int8 types, int32 offsets and
 */

/* 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)\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\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_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,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_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", 1, 3, 3, 1); __PYX_ERR(2, 944, __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", 1, 3, 3, 2); __PYX_ERR(2, 944, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_dense") < 0)) __PYX_ERR(2, 944, __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_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]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_dense", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 944, __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(2, 944, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value_offsets), __pyx_ptype_7pyarrow_3lib_Array, 1, "value_offsets", 0))) __PYX_ERR(2, 944, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_children), (&PyList_Type), 1, "children", 1))) __PYX_ERR(2, 944, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UnionArray_from_dense(__pyx_v_types, __pyx_v_value_offsets, __pyx_v_children);

  /* 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) {
  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;
  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;
  __Pyx_RefNannySetupContext("from_dense", 0);

  /* "pyarrow/array.pxi":962
 *         cdef vector[shared_ptr[CArray]] c
 *         cdef Array child
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c.push_back(child.sp_array)
 *         with nogil:
 */
  if (unlikely(__pyx_v_children == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(2, 962, __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(2, 962, __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(2, 962, __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(2, 962, __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":963
 *         cdef Array child
 *         for child in children:
 *             c.push_back(child.sp_array)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(CUnionArray.MakeDense(
 */
    try {
      __pyx_v_c.push_back(__pyx_v_child->sp_array);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(2, 963, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":962
 *         cdef vector[shared_ptr[CArray]] c
 *         cdef Array child
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c.push_back(child.sp_array)
 *         with nogil:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":964
 *         for child in children:
 *             c.push_back(child.sp_array)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CUnionArray.MakeDense(
 *                 deref(types.ap), deref(value_offsets.ap), c, &out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":965
 *             c.push_back(child.sp_array)
 *         with nogil:
 *             check_status(CUnionArray.MakeDense(             # <<<<<<<<<<<<<<
 *                 deref(types.ap), deref(value_offsets.ap), c, &out))
 *         return pyarrow_wrap_array(out)
 */
        __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status( arrow::UnionArray::MakeDense((*__pyx_v_types->ap), (*__pyx_v_value_offsets->ap), __pyx_v_c, (&__pyx_v_out))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 965, __pyx_L6_error)
      }

      /* "pyarrow/array.pxi":964
 *         for child in children:
 *             c.push_back(child.sp_array)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CUnionArray.MakeDense(
 *                 deref(types.ap), deref(value_offsets.ap), c, &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":967
 *             check_status(CUnionArray.MakeDense(
 *                 deref(types.ap), deref(value_offsets.ap), c, &out))
 *         return pyarrow_wrap_array(out)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":944
 * 
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children):             # <<<<<<<<<<<<<<
 *         """
 *         Construct dense UnionArray from arrays of int8 types, int32 offsets and
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":970
 * 
 *     @staticmethod
 *     def from_sparse(Array types, list children):             # <<<<<<<<<<<<<<
 *         """
 *         Construct sparse UnionArray from arrays of int8 types and children
 */

/* 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)\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\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_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_sparse (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_types,&__pyx_n_s_children,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_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", 1, 2, 2, 1); __PYX_ERR(2, 970, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_sparse") < 0)) __PYX_ERR(2, 970, __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_types = ((struct __pyx_obj_7pyarrow_3lib_Array *)values[0]);
    __pyx_v_children = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_sparse", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 970, __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(2, 970, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_children), (&PyList_Type), 1, "children", 1))) __PYX_ERR(2, 970, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_10UnionArray_2from_sparse(__pyx_v_types, __pyx_v_children);

  /* 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) {
  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;
  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;
  __Pyx_RefNannySetupContext("from_sparse", 0);

  /* "pyarrow/array.pxi":987
 *         cdef vector[shared_ptr[CArray]] c
 *         cdef Array child
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c.push_back(child.sp_array)
 *         with nogil:
 */
  if (unlikely(__pyx_v_children == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(2, 987, __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(2, 987, __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(2, 987, __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(2, 987, __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":988
 *         cdef Array child
 *         for child in children:
 *             c.push_back(child.sp_array)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(CUnionArray.MakeSparse(deref(types.ap), c, &out))
 */
    try {
      __pyx_v_c.push_back(__pyx_v_child->sp_array);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(2, 988, __pyx_L1_error)
    }

    /* "pyarrow/array.pxi":987
 *         cdef vector[shared_ptr[CArray]] c
 *         cdef Array child
 *         for child in children:             # <<<<<<<<<<<<<<
 *             c.push_back(child.sp_array)
 *         with nogil:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/array.pxi":989
 *         for child in children:
 *             c.push_back(child.sp_array)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CUnionArray.MakeSparse(deref(types.ap), c, &out))
 *         return pyarrow_wrap_array(out)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/array.pxi":990
 *             c.push_back(child.sp_array)
 *         with nogil:
 *             check_status(CUnionArray.MakeSparse(deref(types.ap), c, &out))             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(out)
 * 
 */
        __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status( arrow::UnionArray::MakeSparse((*__pyx_v_types->ap), __pyx_v_c, (&__pyx_v_out))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 990, __pyx_L6_error)
      }

      /* "pyarrow/array.pxi":989
 *         for child in children:
 *             c.push_back(child.sp_array)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CUnionArray.MakeSparse(deref(types.ap), c, &out))
 *         return pyarrow_wrap_array(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":991
 *         with nogil:
 *             check_status(CUnionArray.MakeSparse(deref(types.ap), c, &out))
 *         return pyarrow_wrap_array(out)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":970
 * 
 *     @staticmethod
 *     def from_sparse(Array types, list children):             # <<<<<<<<<<<<<<
 *         """
 *         Construct sparse UnionArray from arrays of int8 types and children
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":997
 * 
 *     @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":998
 *     @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(2, 997, __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(2, 997, __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(2, 997, __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(2, 997, __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(2, 998, __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(2, 999, __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(2, 997, __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(2, 997, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "data", 0))) __PYX_ERR(2, 997, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_null_bitmap), __pyx_ptype_7pyarrow_3lib_Buffer, 1, "null_bitmap", 0))) __PYX_ERR(2, 998, __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":997
 * 
 *     @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) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_c_null_bitmap;
  std::shared_ptr< arrow::Array>  __pyx_v_out;
  PyObject *__pyx_r = NULL;
  __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("from_buffers", 0);

  /* "pyarrow/array.pxi":1021
 *         cdef shared_ptr[CArray] out
 * 
 *         if null_bitmap is not None:             # <<<<<<<<<<<<<<
 *             c_null_bitmap = null_bitmap.buffer
 *         else:
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_null_bitmap) != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1022
 * 
 *         if null_bitmap is not None:
 *             c_null_bitmap = null_bitmap.buffer             # <<<<<<<<<<<<<<
 *         else:
 *             null_count = 0
 */
    __pyx_t_3 = __pyx_v_null_bitmap->buffer;
    __pyx_v_c_null_bitmap = __pyx_t_3;

    /* "pyarrow/array.pxi":1021
 *         cdef shared_ptr[CArray] out
 * 
 *         if null_bitmap is not None:             # <<<<<<<<<<<<<<
 *             c_null_bitmap = null_bitmap.buffer
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1024
 *             c_null_bitmap = null_bitmap.buffer
 *         else:
 *             null_count = 0             # <<<<<<<<<<<<<<
 * 
 *         out.reset(new CStringArray(
 */
  /*else*/ {
    __pyx_v_null_count = 0;
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":1026
 *             null_count = 0
 * 
 *         out.reset(new CStringArray(             # <<<<<<<<<<<<<<
 *             length, value_offsets.buffer, data.buffer, c_null_bitmap,
 *             null_count, offset))
 */
  __pyx_v_out.reset(new  arrow::StringArray(__pyx_v_length, __pyx_v_value_offsets->buffer, __pyx_v_data->buffer, __pyx_v_c_null_bitmap, __pyx_v_null_count, __pyx_v_offset));

  /* "pyarrow/array.pxi":1029
 *             length, value_offsets.buffer, data.buffer, c_null_bitmap,
 *             null_count, offset))
 *         return pyarrow_wrap_array(out)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_out); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":997
 * 
 *     @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_4);
  __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":1038
 * cdef class DictionaryArray(Array):
 * 
 *     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":1039
 * 
 *     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":1038
 * cdef class DictionaryArray(Array):
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "pyarrow/array.pxi":1042
 * 
 *     @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":1043
 *     @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":1045
 *         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":1046
 * 
 *         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(2, 1046, __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":1045
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 *         if self._dictionary is None:             # <<<<<<<<<<<<<<
 *             self._dictionary = pyarrow_wrap_array(darr.dictionary())
 * 
 */
  }

  /* "pyarrow/array.pxi":1048
 *             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":1042
 * 
 *     @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":1051
 * 
 *     @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":1052
 *     @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":1054
 *         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":1055
 * 
 *         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(2, 1055, __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":1054
 *         cdef CDictionaryArray* darr = <CDictionaryArray*>(self.ap)
 * 
 *         if self._indices is None:             # <<<<<<<<<<<<<<
 *             self._indices = pyarrow_wrap_array(darr.indices())
 * 
 */
  }

  /* "pyarrow/array.pxi":1057
 *             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":1051
 * 
 *     @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":1060
 * 
 *     @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":1062
 *     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(2, 1060, __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(2, 1060, __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(2, 1060, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":1060
 * 
 *     @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(2, 1061, __pyx_L3_error)
    } else {

      /* "pyarrow/array.pxi":1061
 *     @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(2, 1061, __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(2, 1060, __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(2, 1062, __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":1060
 * 
 *     @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;
  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);
  __Pyx_INCREF(__pyx_v_mask);

  /* "pyarrow/array.pxi":1092
 *             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":1093
 * 
 *         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":1094
 *         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__89, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1094, __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(2, 1094, __pyx_L1_error)

      /* "pyarrow/array.pxi":1093
 * 
 *         if isinstance(indices, Array):
 *             if mask is not None:             # <<<<<<<<<<<<<<
 *                 raise NotImplementedError(
 *                     "mask not implemented with Arrow array inputs yet")
 */
    }

    /* "pyarrow/array.pxi":1096
 *                 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(2, 1096, __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":1092
 *             shared_ptr[CArray] c_result
 * 
 *         if isinstance(indices, Array):             # <<<<<<<<<<<<<<
 *             if mask is not None:
 *                 raise NotImplementedError(
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1098
 *             _indices = indices
 *         else:
 *             if from_pandas:             # <<<<<<<<<<<<<<
 *                 if mask is None:
 *                     mask = indices == -1
 */
  /*else*/ {
    __pyx_t_1 = (__pyx_v_from_pandas != 0);
    if (__pyx_t_1) {

      /* "pyarrow/array.pxi":1099
 *         else:
 *             if from_pandas:
 *                 if mask is None:             # <<<<<<<<<<<<<<
 *                     mask = indices == -1
 *                 else:
 */
      __pyx_t_1 = (__pyx_v_mask == Py_None);
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (__pyx_t_2) {

        /* "pyarrow/array.pxi":1100
 *             if from_pandas:
 *                 if mask is None:
 *                     mask = indices == -1             # <<<<<<<<<<<<<<
 *                 else:
 *                     mask = mask | (indices == -1)
 */
        __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_indices, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1100, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_mask, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "pyarrow/array.pxi":1099
 *         else:
 *             if from_pandas:
 *                 if mask is None:             # <<<<<<<<<<<<<<
 *                     mask = indices == -1
 *                 else:
 */
        goto __pyx_L6;
      }

      /* "pyarrow/array.pxi":1102
 *                     mask = indices == -1
 *                 else:
 *                     mask = mask | (indices == -1)             # <<<<<<<<<<<<<<
 *             _indices = array(indices, mask=mask, memory_pool=memory_pool)
 * 
 */
      /*else*/ {
        __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_indices, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1102, __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(2, 1102, __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_L6:;

      /* "pyarrow/array.pxi":1098
 *             _indices = indices
 *         else:
 *             if from_pandas:             # <<<<<<<<<<<<<<
 *                 if mask is None:
 *                     mask = indices == -1
 */
    }

    /* "pyarrow/array.pxi":1103
 *                 else:
 *                     mask = mask | (indices == -1)
 *             _indices = array(indices, mask=mask, memory_pool=memory_pool)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(dictionary, Array):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_indices);
    __Pyx_GIVEREF(__pyx_v_indices);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_indices);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mask, __pyx_v_mask) < 0) __PYX_ERR(2, 1103, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < 0) __PYX_ERR(2, 1103, __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(2, 1103, __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;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(2, 1103, __pyx_L1_error)
    __pyx_v__indices = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_6);
    __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":1105
 *             _indices = array(indices, mask=mask, memory_pool=memory_pool)
 * 
 *         if isinstance(dictionary, Array):             # <<<<<<<<<<<<<<
 *             _dictionary = dictionary
 *         else:
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_dictionary, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/array.pxi":1106
 * 
 *         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(2, 1106, __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":1105
 *             _indices = array(indices, mask=mask, memory_pool=memory_pool)
 * 
 *         if isinstance(dictionary, Array):             # <<<<<<<<<<<<<<
 *             _dictionary = dictionary
 *         else:
 */
    goto __pyx_L7;
  }

  /* "pyarrow/array.pxi":1108
 *             _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(2, 1108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1108, __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_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < 0) __PYX_ERR(2, 1108, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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(2, 1108, __pyx_L1_error)
    __pyx_v__dictionary = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L7:;

  /* "pyarrow/array.pxi":1110
 *             _dictionary = array(dictionary, memory_pool=memory_pool)
 * 
 *         if not isinstance(_indices, IntegerArray):             # <<<<<<<<<<<<<<
 *             raise ValueError('Indices must be integer type')
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v__indices), __pyx_ptype_7pyarrow_3lib_IntegerArray); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":1111
 * 
 *         if not isinstance(_indices, IntegerArray):
 *             raise ValueError('Indices must be integer type')             # <<<<<<<<<<<<<<
 * 
 *         cdef c_bool c_ordered = ordered
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1111, __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(2, 1111, __pyx_L1_error)

    /* "pyarrow/array.pxi":1110
 *             _dictionary = array(dictionary, memory_pool=memory_pool)
 * 
 *         if not isinstance(_indices, IntegerArray):             # <<<<<<<<<<<<<<
 *             raise ValueError('Indices must be integer type')
 * 
 */
  }

  /* "pyarrow/array.pxi":1113
 *             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":1115
 *         cdef c_bool c_ordered = ordered
 * 
 *         c_type.reset(new CDictionaryType(_indices.type.sp_type,             # <<<<<<<<<<<<<<
 *                                          _dictionary.sp_array, c_ordered))
 * 
 */
  __pyx_v_c_type.reset(new  arrow::DictionaryType(__pyx_v__indices->type->sp_type, __pyx_v__dictionary->sp_array, __pyx_v_c_ordered));

  /* "pyarrow/array.pxi":1118
 *                                          _dictionary.sp_array, c_ordered))
 * 
 *         if safe:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(
 */
  __pyx_t_2 = (__pyx_v_safe != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1119
 * 
 *         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":1120
 *         if safe:
 *             with nogil:
 *                 check_status(             # <<<<<<<<<<<<<<
 *                     CDictionaryArray.FromArrays(c_type, _indices.sp_array,
 *                                                 &c_result))
 */
          __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status( arrow::DictionaryArray::FromArrays(__pyx_v_c_type, __pyx_v__indices->sp_array, (&__pyx_v_c_result))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(2, 1120, __pyx_L11_error)
        }

        /* "pyarrow/array.pxi":1119
 * 
 *         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_L12;
          }
          __pyx_L11_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L12:;
        }
    }

    /* "pyarrow/array.pxi":1118
 *                                          _dictionary.sp_array, c_ordered))
 * 
 *         if safe:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(
 */
    goto __pyx_L9;
  }

  /* "pyarrow/array.pxi":1124
 *                                                 &c_result))
 *         else:
 *             c_result.reset(new CDictionaryArray(c_type, _indices.sp_array))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(c_result)
 */
  /*else*/ {
    __pyx_v_c_result.reset(new  arrow::DictionaryArray(__pyx_v_c_type, __pyx_v__indices->sp_array));
  }
  __pyx_L9:;

  /* "pyarrow/array.pxi":1126
 *             c_result.reset(new CDictionaryArray(c_type, _indices.sp_array))
 * 
 *         return pyarrow_wrap_array(c_result)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_c_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1060
 * 
 *     @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(__pyx_v_mask);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1131
 * cdef class StructArray(Array):
 * 
 *     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 : int\n            Index / position 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) {
  int __pyx_v_ix;
   arrow::StructArray *__pyx_v_sarr;
  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("field", 0);

  /* "pyarrow/array.pxi":1145
 *         """
 *         cdef:
 *             int ix = <int> _normalize_index(index, self.ap.num_fields())             # <<<<<<<<<<<<<<
 *             CStructArray* sarr = <CStructArray*> self.ap
 *         return pyarrow_wrap_array(sarr.field(ix))
 */
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1145, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_1, __pyx_v_self->__pyx_base.ap->num_fields()); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1L))) __PYX_ERR(2, 1145, __pyx_L1_error)
  __pyx_v_ix = ((int)__pyx_t_2);

  /* "pyarrow/array.pxi":1146
 *         cdef:
 *             int ix = <int> _normalize_index(index, self.ap.num_fields())
 *             CStructArray* sarr = <CStructArray*> self.ap             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_array(sarr.field(ix))
 * 
 */
  __pyx_v_sarr = (( arrow::StructArray *)__pyx_v_self->__pyx_base.ap);

  /* "pyarrow/array.pxi":1147
 *             int ix = <int> _normalize_index(index, self.ap.num_fields())
 *             CStructArray* sarr = <CStructArray*> self.ap
 *         return pyarrow_wrap_array(sarr.field(ix))             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self, MemoryPool memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_sarr->field(__pyx_v_ix)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1131
 * cdef class StructArray(Array):
 * 
 *     def field(self, index):             # <<<<<<<<<<<<<<
 *         """
 *         Retrieves the child array belonging to field
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __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":1149
 *         return pyarrow_wrap_array(sarr.field(ix))
 * 
 *     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(2, 1149, __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(2, 1149, __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(2, 1149, __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_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":1165
 *         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":1166
 *             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":1168
 *             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":1169
 * 
 *         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(2, 1169, __pyx_L4_error)
      }

      /* "pyarrow/array.pxi":1168
 *             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":1171
 *             check_status(sarr.Flatten(pool, &arrays))
 * 
 *         return [pyarrow_wrap_array(arr) for arr in arrays]             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1171, __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_v_arr = __pyx_t_4;
    __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_arr); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 1171, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1149
 *         return pyarrow_wrap_array(sarr.field(ix))
 * 
 *     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":1174
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct StructArray from collection of arrays representing each field
 */

/* 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)\n\n        Construct StructArray from collection of arrays representing each field\n        in the struct\n\n        Parameters\n        ----------\n        arrays : sequence of Array\n        names : List[str]\n            Field names\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_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_arrays (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arrays,&__pyx_n_s_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_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--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_arrays") < 0)) __PYX_ERR(2, 1174, __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_names = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1174, __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);

  /* 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) {
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v_array = 0;
  std::vector<std::shared_ptr< arrow::Array> >  __pyx_v_c_arrays;
  std::shared_ptr< arrow::Array>  __pyx_v_c_result;
  Py_ssize_t __pyx_v_num_arrays;
  Py_ssize_t __pyx_v_length;
  Py_ssize_t __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_DataType *__pyx_v_struct_type = 0;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_name = 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;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  std::shared_ptr< arrow::Array>  __pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *(*__pyx_t_17)(PyObject *);
  int __pyx_t_18;
  __Pyx_RefNannySetupContext("from_arrays", 0);
  __Pyx_INCREF(__pyx_v_arrays);

  /* "pyarrow/array.pxi":1198
 *             ssize_t i
 * 
 *         if names is None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Names are currently required')
 * 
 */
  __pyx_t_1 = (__pyx_v_names == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":1199
 * 
 *         if names is None:
 *             raise ValueError('Names are currently required')             # <<<<<<<<<<<<<<
 * 
 *         arrays = [asarray(x) for x in arrays]
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1199, __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(2, 1199, __pyx_L1_error)

    /* "pyarrow/array.pxi":1198
 *             ssize_t i
 * 
 *         if names is None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Names are currently required')
 * 
 */
  }

  /* "pyarrow/array.pxi":1201
 *             raise ValueError('Names are currently required')
 * 
 *         arrays = [asarray(x) for x in arrays]             # <<<<<<<<<<<<<<
 * 
 *         num_arrays = len(arrays)
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  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_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_arrays); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1201, __pyx_L1_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(2, 1201, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1201, __pyx_L1_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(2, 1201, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1201, __pyx_L1_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(2, 1201, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1201, __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_7 = (__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_7)) __PYX_ERR(2, 1201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(2, 1201, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF_SET(__pyx_v_arrays, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/array.pxi":1203
 *         arrays = [asarray(x) for x in arrays]
 * 
 *         num_arrays = len(arrays)             # <<<<<<<<<<<<<<
 *         if num_arrays == 0:
 *             raise ValueError("arrays list is empty")
 */
  __pyx_t_5 = PyObject_Length(__pyx_v_arrays); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 1203, __pyx_L1_error)
  __pyx_v_num_arrays = __pyx_t_5;

  /* "pyarrow/array.pxi":1204
 * 
 *         num_arrays = len(arrays)
 *         if num_arrays == 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("arrays list is empty")
 * 
 */
  __pyx_t_2 = ((__pyx_v_num_arrays == 0) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/array.pxi":1205
 *         num_arrays = len(arrays)
 *         if num_arrays == 0:
 *             raise ValueError("arrays list is empty")             # <<<<<<<<<<<<<<
 * 
 *         length = len(arrays[0])
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1205, __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(2, 1205, __pyx_L1_error)

    /* "pyarrow/array.pxi":1204
 * 
 *         num_arrays = len(arrays)
 *         if num_arrays == 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("arrays list is empty")
 * 
 */
  }

  /* "pyarrow/array.pxi":1207
 *             raise ValueError("arrays list is empty")
 * 
 *         length = len(arrays[0])             # <<<<<<<<<<<<<<
 * 
 *         c_arrays.resize(num_arrays)
 */
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_arrays, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 1207, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_length = __pyx_t_5;

  /* "pyarrow/array.pxi":1209
 *         length = len(arrays[0])
 * 
 *         c_arrays.resize(num_arrays)             # <<<<<<<<<<<<<<
 *         for i in range(num_arrays):
 *             array = arrays[i]
 */
  try {
    __pyx_v_c_arrays.resize(__pyx_v_num_arrays);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(2, 1209, __pyx_L1_error)
  }

  /* "pyarrow/array.pxi":1210
 * 
 *         c_arrays.resize(num_arrays)
 *         for i in range(num_arrays):             # <<<<<<<<<<<<<<
 *             array = arrays[i]
 *             if len(array) != length:
 */
  __pyx_t_10 = __pyx_v_num_arrays;
  __pyx_t_11 = __pyx_t_10;
  for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
    __pyx_v_i = __pyx_t_12;

    /* "pyarrow/array.pxi":1211
 *         c_arrays.resize(num_arrays)
 *         for i in range(num_arrays):
 *             array = arrays[i]             # <<<<<<<<<<<<<<
 *             if len(array) != length:
 *                 raise ValueError("All arrays must have the same length")
 */
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_arrays, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1211, __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(2, 1211, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_array, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "pyarrow/array.pxi":1212
 *         for i in range(num_arrays):
 *             array = arrays[i]
 *             if len(array) != length:             # <<<<<<<<<<<<<<
 *                 raise ValueError("All arrays must have the same length")
 *             c_arrays[i] = array.sp_array
 */
    __pyx_t_5 = PyObject_Length(((PyObject *)__pyx_v_array)); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 1212, __pyx_L1_error)
    __pyx_t_2 = ((__pyx_t_5 != __pyx_v_length) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/array.pxi":1213
 *             array = arrays[i]
 *             if len(array) != length:
 *                 raise ValueError("All arrays must have the same length")             # <<<<<<<<<<<<<<
 *             c_arrays[i] = array.sp_array
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1213, __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(2, 1213, __pyx_L1_error)

      /* "pyarrow/array.pxi":1212
 *         for i in range(num_arrays):
 *             array = arrays[i]
 *             if len(array) != length:             # <<<<<<<<<<<<<<
 *                 raise ValueError("All arrays must have the same length")
 *             c_arrays[i] = array.sp_array
 */
    }

    /* "pyarrow/array.pxi":1214
 *             if len(array) != length:
 *                 raise ValueError("All arrays must have the same length")
 *             c_arrays[i] = array.sp_array             # <<<<<<<<<<<<<<
 * 
 *         cdef DataType struct_type = struct([
 */
    __pyx_t_13 = __pyx_v_array->sp_array;
    (__pyx_v_c_arrays[__pyx_v_i]) = __pyx_t_13;
  }

  /* "pyarrow/array.pxi":1216
 *             c_arrays[i] = array.sp_array
 * 
 *         cdef DataType struct_type = struct([             # <<<<<<<<<<<<<<
 *             field(name, array.type)
 *             for name, array in
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_struct); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 1216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/array.pxi":1219
 *             field(name, array.type)
 *             for name, array in
 *             zip(names, arrays)             # <<<<<<<<<<<<<<
 *         ])
 * 
 */
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_INCREF(__pyx_v_names);
  __Pyx_GIVEREF(__pyx_v_names);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_names);
  __Pyx_INCREF(__pyx_v_arrays);
  __Pyx_GIVEREF(__pyx_v_arrays);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_arrays);
  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
    __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_6 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1219, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_8))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 1219, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1219, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(2, 1219, __pyx_L1_error)
        #else
        __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1219, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
      }
    } else {
      __pyx_t_9 = __pyx_t_6(__pyx_t_8);
      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(2, 1219, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_9);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
      PyObject* sequence = __pyx_t_9;
      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(2, 1218, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_14 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_14 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_15 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(__pyx_t_15);
      #else
      __pyx_t_14 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(2, 1218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 1218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      #endif
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_16 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 1218, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext;
      index = 0; __pyx_t_14 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_14)) goto __pyx_L12_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_14);
      index = 1; __pyx_t_15 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_15)) goto __pyx_L12_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_15);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(2, 1218, __pyx_L1_error)
      __pyx_t_17 = NULL;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      goto __pyx_L13_unpacking_done;
      __pyx_L12_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_17 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(2, 1218, __pyx_L1_error)
      __pyx_L13_unpacking_done:;
    }

    /* "pyarrow/array.pxi":1218
 *         cdef DataType struct_type = struct([
 *             field(name, array.type)
 *             for name, array in             # <<<<<<<<<<<<<<
 *             zip(names, arrays)
 *         ])
 */
    if (!(likely(((__pyx_t_15) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_15, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(2, 1218, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_14);
    __pyx_t_14 = 0;
    __Pyx_XDECREF_SET(__pyx_v_array, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_15));
    __pyx_t_15 = 0;

    /* "pyarrow/array.pxi":1217
 * 
 *         cdef DataType struct_type = struct([
 *             field(name, array.type)             # <<<<<<<<<<<<<<
 *             for name, array in
 *             zip(names, arrays)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_field); if (unlikely(!__pyx_t_15)) __PYX_ERR(2, 1217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_14 = NULL;
    __pyx_t_18 = 0;
    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_18 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_15)) {
      PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_name, ((PyObject *)__pyx_v_array->type)};
      __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1217, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_GOTREF(__pyx_t_9);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) {
      PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_v_name, ((PyObject *)__pyx_v_array->type)};
      __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-__pyx_t_18, 2+__pyx_t_18); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1217, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_GOTREF(__pyx_t_9);
    } else
    #endif
    {
      __pyx_t_16 = PyTuple_New(2+__pyx_t_18); if (unlikely(!__pyx_t_16)) __PYX_ERR(2, 1217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      if (__pyx_t_14) {
        __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_14); __pyx_t_14 = NULL;
      }
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_18, __pyx_v_name);
      __Pyx_INCREF(((PyObject *)__pyx_v_array->type));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_array->type));
      PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_18, ((PyObject *)__pyx_v_array->type));
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_16, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 1217, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    }
    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_9))) __PYX_ERR(2, 1216, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "pyarrow/array.pxi":1218
 *         cdef DataType struct_type = struct([
 *             field(name, array.type)
 *             for name, array in             # <<<<<<<<<<<<<<
 *             zip(names, arrays)
 *         ])
 */
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(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_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/array.pxi":1216
 *             c_arrays[i] = array.sp_array
 * 
 *         cdef DataType struct_type = struct([             # <<<<<<<<<<<<<<
 *             field(name, array.type)
 *             for name, array in
 */
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_DataType))))) __PYX_ERR(2, 1216, __pyx_L1_error)
  __pyx_v_struct_type = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/array.pxi":1222
 *         ])
 * 
 *         c_result.reset(new CStructArray(struct_type.sp_type, length, c_arrays))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_array(c_result)
 */
  __pyx_v_c_result.reset(new  arrow::StructArray(__pyx_v_struct_type->sp_type, __pyx_v_length, __pyx_v_c_arrays, NULL));

  /* "pyarrow/array.pxi":1224
 *         c_result.reset(new CStructArray(struct_type.sp_type, length, c_arrays))
 * 
 *         return pyarrow_wrap_array(c_result)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_c_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1174
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct StructArray from collection of arrays representing each field
 */

  /* 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_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("pyarrow.lib.StructArray.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_array);
  __Pyx_XDECREF((PyObject *)__pyx_v_struct_type);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_arrays);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/array.pxi":1257
 * 
 * 
 * cdef object get_series_values(object obj):             # <<<<<<<<<<<<<<
 *     if isinstance(obj, PandasSeries):
 *         result = obj.values
 */

static PyObject *__pyx_f_7pyarrow_3lib_get_series_values(PyObject *__pyx_v_obj) {
  PyObject *__pyx_v_result = 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;
  __Pyx_RefNannySetupContext("get_series_values", 0);

  /* "pyarrow/array.pxi":1258
 * 
 * cdef object get_series_values(object obj):
 *     if isinstance(obj, PandasSeries):             # <<<<<<<<<<<<<<
 *         result = obj.values
 *     elif isinstance(obj, np.ndarray):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PandasSeries); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1258, __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(2, 1258, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/array.pxi":1259
 * cdef object get_series_values(object obj):
 *     if isinstance(obj, PandasSeries):
 *         result = obj.values             # <<<<<<<<<<<<<<
 *     elif isinstance(obj, np.ndarray):
 *         result = obj
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_result = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyarrow/array.pxi":1258
 * 
 * cdef object get_series_values(object obj):
 *     if isinstance(obj, PandasSeries):             # <<<<<<<<<<<<<<
 *         result = obj.values
 *     elif isinstance(obj, np.ndarray):
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1260
 *     if isinstance(obj, PandasSeries):
 *         result = obj.values
 *     elif isinstance(obj, np.ndarray):             # <<<<<<<<<<<<<<
 *         result = obj
 *     else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_4); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/array.pxi":1261
 *         result = obj.values
 *     elif isinstance(obj, np.ndarray):
 *         result = obj             # <<<<<<<<<<<<<<
 *     else:
 *         result = PandasSeries(obj).values
 */
    __Pyx_INCREF(__pyx_v_obj);
    __pyx_v_result = __pyx_v_obj;

    /* "pyarrow/array.pxi":1260
 *     if isinstance(obj, PandasSeries):
 *         result = obj.values
 *     elif isinstance(obj, np.ndarray):             # <<<<<<<<<<<<<<
 *         result = obj
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/array.pxi":1263
 *         result = obj
 *     else:
 *         result = PandasSeries(obj).values             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_PandasSeries); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1263, __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_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_obj);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1263, __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_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_result = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/array.pxi":1265
 *         result = PandasSeries(obj).values
 * 
 *     return result             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/array.pxi":1257
 * 
 * 
 * cdef object get_series_values(object obj):             # <<<<<<<<<<<<<<
 *     if isinstance(obj, PandasSeries):
 *         result = obj.values
 */

  /* 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.get_series_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/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(9, 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(9, 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(9, 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(9, 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(9, 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(9, 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(9, 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(9, 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(9, 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(9, 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(9, 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(9, 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__94, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 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(9, 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(9, 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(9, 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(9, 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(9, 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(9, 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(9, 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(9, 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(9, 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(9, 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(9, 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__95, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__96, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":40
 *     """
 * 
 *     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":41
 * 
 *     def __cinit__(self):
 *         self.chunked_array = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  __pyx_v_self->chunked_array = NULL;

  /* "pyarrow/table.pxi":40
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.chunked_array = NULL
 * 
 */

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

/* "pyarrow/table.pxi":43
 *         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":44
 * 
 *     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__97, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 44, __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, 44, __pyx_L1_error)

  /* "pyarrow/table.pxi":43
 *         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":47
 *                         "`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":48
 * 
 *     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":49
 *     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":47
 *                         "`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":51
 *         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":52
 * 
 *     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(10, 52, __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(10, 52, __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(10, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 52, __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(10, 52, __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":51
 *         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":55
 * 
 *     @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":56
 *     @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(10, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":55
 * 
 *     @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":58
 *         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":59
 * 
 *     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(10, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":58
 *         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":61
 *         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":62
 * 
 *     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(10, 62, __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(10, 62, __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(10, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":61
 *         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":64
 *         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":65
 * 
 *     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(10, 65, __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(10, 65, __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":66
 *     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_s_0_1, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 66, __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(10, 66, __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(10, 66, __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(10, 66, __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(10, 66, __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":64
 *         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":68
 *         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(10, 68, __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(10, 68, __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(10, 68, __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(10, 68, __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":72
 *             c_string result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 PrettyPrint(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":73
 * 
 *         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(10, 73, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":72
 *             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":81
 *             )
 * 
 *         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(10, 81, __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(10, 81, __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(10, 81, __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":68
 *         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":83
 *         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":84
 * 
 *     def __str__(self):
 *         return self.format()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __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(10, 84, __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(10, 84, __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":83
 *         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":87
 * 
 *     @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":95
 *         int
 *         """
 *         return self.chunked_array.null_count()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __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(10, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":87
 * 
 *     @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;
}
static PyObject *__pyx_gb_7pyarrow_3lib_12ChunkedArray_18generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/table.pxi":97
 *         return self.chunked_array.null_count()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         for chunk in self.iterchunks():
 *             for item in chunk:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_17__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_17__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_16__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_16__iter__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__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(10, 97, __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_18generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_ChunkedArray___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(10, 97, __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_18generator5(__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;
  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(10, 97, __pyx_L1_error)

  /* "pyarrow/table.pxi":98
 * 
 *     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(10, 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(10, 98, __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(10, 98, __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(10, 98, __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(10, 98, __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(10, 98, __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(10, 98, __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(10, 98, __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(10, 98, __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":99
 *     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(10, 99, __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(10, 99, __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(10, 99, __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(10, 99, __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(10, 99, __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(10, 99, __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(10, 99, __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":100
 *         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(10, 100, __pyx_L1_error)

      /* "pyarrow/table.pxi":99
 *     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":98
 * 
 *     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":97
 *         return self.chunked_array.null_count()
 * 
 *     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":102
 *                 yield item
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_20__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_20__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_19__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_19__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":103
 * 
 *     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":104
 *     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(10, 104, __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(10, 104, __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(10, 104, __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(10, 104, __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(10, 104, __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":103
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 *         elif isinstance(key, six.integer_types):
 */
  }

  /* "pyarrow/table.pxi":105
 *         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(10, 105, __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(10, 105, __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(10, 105, __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":106
 *             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(10, 106, __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(10, 106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":105
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 *         elif isinstance(key, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self.getitem(key)
 *         else:
 */
  }

  /* "pyarrow/table.pxi":108
 *             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__98, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 108, __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(10, 108, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":102
 *                 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":110
 *             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":113
 *         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(10, 113, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_index = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":114
 * 
 *         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(10, 114, __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(10, 114, __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":115
 *         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(10, 115, __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(10, 115, __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(10, 115, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_7) {

      /* "pyarrow/table.pxi":116
 *         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(10, 116, __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(10, 116, __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(10, 116, __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(10, 116, __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":115
 *         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":118
 *                 return self.chunk(j)[index]
 *             else:
 *                 index -= self.chunked_array.chunk(j).get().length()             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, ChunkedArray 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(10, 118, __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(10, 118, __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":110
 *             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":120
 *                 index -= self.chunked_array.chunk(j).get().length()
 * 
 *     def equals(self, ChunkedArray other):             # <<<<<<<<<<<<<<
 *         """
 *         Return whether the contents of two chunked arrays are equal
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_22equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_21equals[] = "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_22equals(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(10, 120, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_12ChunkedArray_21equals(((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_21equals(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;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/table.pxi":133
 *         """
 *         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":134
 *         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":137
 *             c_bool result
 * 
 *         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":138
 * 
 *         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":137
 *             c_bool result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_arr.Equals(deref(other_arr))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":140
 *             result = this_arr.Equals(deref(other_arr))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def to_pandas(self, bint strings_to_categorical=False,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":120
 *                 index -= self.chunked_array.chunk(j).get().length()
 * 
 *     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_2);
  __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":142
 *         return result
 * 
 *     def to_pandas(self, bint strings_to_categorical=False,             # <<<<<<<<<<<<<<
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,
 *                   bint date_as_object=False):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_24to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_23to_pandas[] = "ChunkedArray.to_pandas(self, bool strings_to_categorical=False, bool zero_copy_only=False, bool integer_object_nulls=False, bool date_as_object=False)\n\n        Convert the arrow::ChunkedArray to an array object suitable for use\n        in pandas\n\n        Parameters\n        ----------\n        strings_to_categorical : boolean, default False\n            Encode string (UTF8) and binary types to pandas.Categorical\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\n        See also\n        --------\n        Column.to_pandas\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_24to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_strings_to_categorical;
  int __pyx_v_zero_copy_only;
  int __pyx_v_integer_object_nulls;
  int __pyx_v_date_as_object;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_strings_to_categorical,&__pyx_n_s_zero_copy_only,&__pyx_n_s_integer_object_nulls,&__pyx_n_s_date_as_object,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 (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strings_to_categorical);
          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_zero_copy_only);
          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_integer_object_nulls);
          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_date_as_object);
          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(10, 142, __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);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_strings_to_categorical = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_strings_to_categorical == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 142, __pyx_L3_error)
    } else {
      __pyx_v_strings_to_categorical = ((int)0);
    }
    if (values[1]) {
      __pyx_v_zero_copy_only = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_zero_copy_only == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 143, __pyx_L3_error)
    } else {

      /* "pyarrow/table.pxi":143
 * 
 *     def to_pandas(self, bint strings_to_categorical=False,
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,             # <<<<<<<<<<<<<<
 *                   bint date_as_object=False):
 *         """
 */
      __pyx_v_zero_copy_only = ((int)0);
    }
    if (values[2]) {
      __pyx_v_integer_object_nulls = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_integer_object_nulls == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 143, __pyx_L3_error)
    } else {
      __pyx_v_integer_object_nulls = ((int)0);
    }
    if (values[3]) {
      __pyx_v_date_as_object = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_date_as_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 144, __pyx_L3_error)
    } else {

      /* "pyarrow/table.pxi":144
 *     def to_pandas(self, bint strings_to_categorical=False,
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,
 *                   bint date_as_object=False):             # <<<<<<<<<<<<<<
 *         """
 *         Convert the arrow::ChunkedArray to an array object suitable for use
 */
      __pyx_v_date_as_object = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_pandas", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 142, __pyx_L3_error)
  __pyx_L3_error:;
  __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_23to_pandas(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self), __pyx_v_strings_to_categorical, __pyx_v_zero_copy_only, __pyx_v_integer_object_nulls, __pyx_v_date_as_object);

  /* "pyarrow/table.pxi":142
 *         return result
 * 
 *     def to_pandas(self, bint strings_to_categorical=False,             # <<<<<<<<<<<<<<
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,
 *                   bint date_as_object=False):
 */

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

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_23to_pandas(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, int __pyx_v_strings_to_categorical, int __pyx_v_zero_copy_only, int __pyx_v_integer_object_nulls, int __pyx_v_date_as_object) {
  PyObject *__pyx_v_out;
  struct arrow::py::PandasOptions __pyx_v_options;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct arrow::py::PandasOptions __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("to_pandas", 0);

  /* "pyarrow/table.pxi":170
 * 
 *         options = PandasOptions(
 *             strings_to_categorical=strings_to_categorical,             # <<<<<<<<<<<<<<
 *             zero_copy_only=zero_copy_only,
 *             integer_object_nulls=integer_object_nulls,
 */
  __pyx_t_1.strings_to_categorical = __pyx_v_strings_to_categorical;

  /* "pyarrow/table.pxi":171
 *         options = PandasOptions(
 *             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_1.zero_copy_only = __pyx_v_zero_copy_only;

  /* "pyarrow/table.pxi":172
 *             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=False)
 */
  __pyx_t_1.integer_object_nulls = __pyx_v_integer_object_nulls;

  /* "pyarrow/table.pxi":173
 *             zero_copy_only=zero_copy_only,
 *             integer_object_nulls=integer_object_nulls,
 *             date_as_object=date_as_object,             # <<<<<<<<<<<<<<
 *             use_threads=False)
 * 
 */
  __pyx_t_1.date_as_object = __pyx_v_date_as_object;

  /* "pyarrow/table.pxi":174
 *             integer_object_nulls=integer_object_nulls,
 *             date_as_object=date_as_object,
 *             use_threads=False)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1.use_threads = 0;
  __pyx_v_options = __pyx_t_1;

  /* "pyarrow/table.pxi":176
 *             use_threads=False)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(libarrow.ConvertChunkedArrayToPandas(
 *                 options,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":177
 * 
 *         with nogil:
 *             check_status(libarrow.ConvertChunkedArrayToPandas(             # <<<<<<<<<<<<<<
 *                 options,
 *                 self.sp_chunked_array,
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::ConvertChunkedArrayToPandas(__pyx_v_options, __pyx_v_self->sp_chunked_array, ((PyObject *)__pyx_v_self), (&__pyx_v_out))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(10, 177, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":176
 *             use_threads=False)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(libarrow.ConvertChunkedArrayToPandas(
 *                 options,
 */
      /*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":182
 *                 self, &out))
 * 
 *         return wrap_array_output(out)             # <<<<<<<<<<<<<<
 * 
 *     def __array__(self, dtype=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_wrap_array_output(__pyx_v_out); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":142
 *         return result
 * 
 *     def to_pandas(self, bint strings_to_categorical=False,             # <<<<<<<<<<<<<<
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,
 *                   bint date_as_object=False):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __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":184
 *         return wrap_array_output(out)
 * 
 *     def __array__(self, dtype=None):             # <<<<<<<<<<<<<<
 *         if dtype is None:
 *             return self.to_pandas()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_26__array__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_25__array__[] = "ChunkedArray.__array__(self, dtype=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_26__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(10, 184, __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(10, 184, __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_25__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_25__array__(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self, PyObject *__pyx_v_dtype) {
  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("__array__", 0);

  /* "pyarrow/table.pxi":185
 * 
 *     def __array__(self, dtype=None):
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             return self.to_pandas()
 *         return self.to_pandas().astype(dtype)
 */
  __pyx_t_1 = (__pyx_v_dtype == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":186
 *     def __array__(self, dtype=None):
 *         if dtype is None:
 *             return self.to_pandas()             # <<<<<<<<<<<<<<
 *         return self.to_pandas().astype(dtype)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_pandas); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 186, __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(10, 186, __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":185
 * 
 *     def __array__(self, dtype=None):
 *         if dtype is None:             # <<<<<<<<<<<<<<
 *             return self.to_pandas()
 *         return self.to_pandas().astype(dtype)
 */
  }

  /* "pyarrow/table.pxi":187
 *         if dtype is None:
 *             return self.to_pandas()
 *         return self.to_pandas().astype(dtype)             # <<<<<<<<<<<<<<
 * 
 *     def dictionary_encode(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_pandas); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 187, __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(10, 187, __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_astype); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 187, __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 && likely(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, __pyx_v_dtype) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_dtype);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":184
 *         return wrap_array_output(out)
 * 
 *     def __array__(self, dtype=None):             # <<<<<<<<<<<<<<
 *         if dtype is None:
 *             return self.to_pandas()
 */

  /* 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.ChunkedArray.__array__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":189
 *         return self.to_pandas().astype(dtype)
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute dictionary-encoded representation of array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_28dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_27dictionary_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_28dictionary_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_27dictionary_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_27dictionary_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":200
 *         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":201
 * 
 *         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(10, 201, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":200
 *         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":205
 *                                  &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(10, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":189
 *         return self.to_pandas().astype(dtype)
 * 
 *     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":207
 *         return wrap_datum(out)
 * 
 *     def unique(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute distinct elements in array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_30unique(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_29unique[] = "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_30unique(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_29unique(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_29unique(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":217
 *         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":218
 * 
 *         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(10, 218, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":217
 *         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":221
 *                 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(10, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":207
 *         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.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":223
 *         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_32slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_31slice[] = "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_32slice(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(10, 223, __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(10, 223, __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_31slice(((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_31slice(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":241
 *         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(10, 241, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(10, 241, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/table.pxi":242
 * 
 *         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__83, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 242, __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, 242, __pyx_L1_error)

    /* "pyarrow/table.pxi":241
 *         cdef shared_ptr[CChunkedArray] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/table.pxi":244
 *             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":245
 * 
 *         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(10, 245, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->chunked_array->Slice(__pyx_t_4);

    /* "pyarrow/table.pxi":244
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.chunked_array.Slice(offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/table.pxi":247
 *             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(10, 247, __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(10, 247, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->chunked_array->Slice(__pyx_t_4, __pyx_t_5);
  }
  __pyx_L4:;

  /* "pyarrow/table.pxi":249
 *             result = self.chunked_array.Slice(offset, length)
 * 
 *         return pyarrow_wrap_chunked_array(result)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = pyarrow_wrap_chunked_array(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":223
 *         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":252
 * 
 *     @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":260
 *         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(10, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":252
 * 
 *     @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":262
 *         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_34chunk(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_33chunk[] = "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_34chunk(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_33chunk(((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_33chunk(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":274
 *         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(10, 274, __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(10, 274, __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(10, 274, __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(10, 274, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(10, 274, __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":275
 *         """
 *         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__99, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 275, __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(10, 275, __pyx_L1_error)

    /* "pyarrow/table.pxi":274
 *         pyarrow.Array
 *         """
 *         if i >= self.num_chunks or i < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Chunk index out of range.')
 * 
 */
  }

  /* "pyarrow/table.pxi":277
 *             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(10, 277, __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(10, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":262
 *         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":280
 * 
 *     @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":281
 *     @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(10, 281, __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(10, 281, __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(10, 281, __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":280
 * 
 *     @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_37generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/table.pxi":283
 *         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_36iterchunks(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_35iterchunks[] = "ChunkedArray.iterchunks(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_36iterchunks(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_35iterchunks(((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_12ChunkedArray_35iterchunks(struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6_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_6_iterchunks *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_6_iterchunks(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_6_iterchunks, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6_iterchunks *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(10, 283, __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_37generator6, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iterchunks, __pyx_n_s_ChunkedArray_iterchunks, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(10, 283, __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_37generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6_iterchunks *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6_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(10, 283, __pyx_L1_error)

  /* "pyarrow/table.pxi":284
 * 
 *     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(10, 284, __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(10, 284, __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(10, 284, __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(10, 284, __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(10, 284, __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(10, 284, __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(10, 284, __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(10, 284, __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(10, 284, __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":285
 *     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(10, 285, __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(10, 285, __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(10, 285, __pyx_L1_error)

    /* "pyarrow/table.pxi":284
 * 
 *     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":283
 *         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":287
 *             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_39to_pylist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_12ChunkedArray_38to_pylist[] = "ChunkedArray.to_pylist(self)\n\n        Convert to a list of native Python objects.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_12ChunkedArray_39to_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_38to_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_38to_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":291
 *         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(10, 291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":292
 *         """
 *         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(10, 292, __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(10, 292, __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(10, 292, __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(10, 292, __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(10, 292, __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(10, 292, __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(10, 292, __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(10, 292, __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(10, 292, __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":293
 *         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(10, 293, __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(10, 293, __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(10, 293, __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(10, 293, __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(10, 293, __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":292
 *         """
 *         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":294
 *         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":287
 *             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/table.pxi":297
 * 
 * 
 * def chunked_array(arrays, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct chunked array from list of array-like objects
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_93chunked_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_92chunked_array[] = "chunked_array(arrays, type=None)\n\n    Construct chunked array from list of array-like objects\n\n    Parameters\n    ----------\n    arrays : list of Array or values coercible to arrays\n    type : DataType or string coercible to DataType\n\n    Returns\n    -------\n    ChunkedArray\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_93chunked_array = {"chunked_array", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_93chunked_array, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_92chunked_array};
static PyObject *__pyx_pw_7pyarrow_3lib_93chunked_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(10, 297, __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(10, 297, __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_92chunked_array(__pyx_self, __pyx_v_arrays, __pyx_v_type);

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

static PyObject *__pyx_pf_7pyarrow_3lib_92chunked_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
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("chunked_array", 0);

  /* "pyarrow/table.pxi":316
 *         shared_ptr[CDataType] sp_data_type
 * 
 *     for x in arrays:             # <<<<<<<<<<<<<<
 *         if isinstance(x, Array):
 *             arr = x
 */
  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(10, 316, __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, 316, __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, 316, __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, 316, __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, 316, __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, 316, __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, 316, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":317
 * 
 *     for x in arrays:
 *         if isinstance(x, Array):             # <<<<<<<<<<<<<<
 *             arr = x
 *             if type is not None:
 */
    __pyx_t_5 = __Pyx_TypeCheck(__pyx_v_x, __pyx_ptype_7pyarrow_3lib_Array); 
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "pyarrow/table.pxi":318
 *     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(10, 318, __pyx_L1_error)
      __pyx_t_4 = __pyx_v_x;
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_v_arr, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4));
      __pyx_t_4 = 0;

      /* "pyarrow/table.pxi":319
 *         if isinstance(x, Array):
 *             arr = x
 *             if type is not None:             # <<<<<<<<<<<<<<
 *                 assert x.type == type
 *         else:
 */
      __pyx_t_6 = (__pyx_v_type != Py_None);
      __pyx_t_5 = (__pyx_t_6 != 0);
      if (__pyx_t_5) {

        /* "pyarrow/table.pxi":320
 *             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_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 320, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_v_type, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 320, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(10, 320, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_5)) {
            PyErr_SetNone(PyExc_AssertionError);
            __PYX_ERR(10, 320, __pyx_L1_error)
          }
        }
        #endif

        /* "pyarrow/table.pxi":319
 *         if isinstance(x, Array):
 *             arr = x
 *             if type is not None:             # <<<<<<<<<<<<<<
 *                 assert x.type == type
 *         else:
 */
      }

      /* "pyarrow/table.pxi":317
 * 
 *     for x in arrays:
 *         if isinstance(x, Array):             # <<<<<<<<<<<<<<
 *             arr = x
 *             if type is not None:
 */
      goto __pyx_L5;
    }

    /* "pyarrow/table.pxi":322
 *                 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(10, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_x);
      __Pyx_GIVEREF(__pyx_v_x);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_x);
      __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_type, __pyx_v_type) < 0) __PYX_ERR(10, 322, __pyx_L1_error)
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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(10, 322, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_arr, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_9));
      __pyx_t_9 = 0;
    }
    __pyx_L5:;

    /* "pyarrow/table.pxi":324
 *             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(10, 324, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":316
 *         shared_ptr[CDataType] sp_data_type
 * 
 *     for x in arrays:             # <<<<<<<<<<<<<<
 *         if isinstance(x, Array):
 *             arr = x
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":326
 *         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_5 = __Pyx_PyObject_IsTrue(__pyx_v_type); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(10, 326, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "pyarrow/table.pxi":327
 * 
 *     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":328
 *     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":326
 *         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_L7;
  }

  /* "pyarrow/table.pxi":330
 *         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_5 = ((__pyx_v_c_arrays.size() == 0) != 0);
    if (unlikely(__pyx_t_5)) {

      /* "pyarrow/table.pxi":331
 *     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_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__100, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 331, __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, 331, __pyx_L1_error)

      /* "pyarrow/table.pxi":330
 *         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":333
 *             raise ValueError("Cannot construct a chunked array with neither "
 *                              "arrays nor type")
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays))             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_chunked_array(sp_chunked_array)
 * 
 */
    __pyx_v_sp_chunked_array.reset(new  arrow::ChunkedArray(__pyx_v_c_arrays));
  }
  __pyx_L7:;

  /* "pyarrow/table.pxi":334
 *                              "arrays nor type")
 *         sp_chunked_array.reset(new CChunkedArray(c_arrays))
 *     return pyarrow_wrap_chunked_array(sp_chunked_array)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = pyarrow_wrap_chunked_array(__pyx_v_sp_chunked_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":297
 * 
 * 
 * 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_1);
  __Pyx_XDECREF(__pyx_t_4);
  __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":337
 * 
 * 
 * def column(object field_or_name, arr):             # <<<<<<<<<<<<<<
 *     """
 *     Create Column object from field/string and array-like data
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_95column(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_94column[] = "column(field_or_name, arr)\n\n    Create Column object from field/string and array-like data\n\n    Parameters\n    ----------\n    field_or_name : string or Field\n    arr : Array, list of Arrays, or ChunkedArray\n\n    Returns\n    -------\n    column : Column\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_95column = {"column", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_95column, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_94column};
static PyObject *__pyx_pw_7pyarrow_3lib_95column(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_field_or_name = 0;
  PyObject *__pyx_v_arr = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("column (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_field_or_name,&__pyx_n_s_arr,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_or_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_arr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("column", 1, 2, 2, 1); __PYX_ERR(10, 337, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "column") < 0)) __PYX_ERR(10, 337, __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_or_name = values[0];
    __pyx_v_arr = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("column", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 337, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_94column(__pyx_self, __pyx_v_field_or_name, __pyx_v_arr);

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

static PyObject *__pyx_pf_7pyarrow_3lib_94column(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_field_or_name, PyObject *__pyx_v_arr) {
  struct __pyx_obj_7pyarrow_3lib_Field *__pyx_v_boxed_field = 0;
  struct __pyx_obj_7pyarrow_3lib_Array *__pyx_v__arr = 0;
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *__pyx_v__carr = 0;
  std::shared_ptr< arrow::Column>  __pyx_v_sp_column;
  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;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("column", 0);
  __Pyx_INCREF(__pyx_v_arr);

  /* "pyarrow/table.pxi":356
 *         shared_ptr[CColumn] sp_column
 * 
 *     if isinstance(arr, list):             # <<<<<<<<<<<<<<
 *         arr = chunked_array(arr)
 *     elif not isinstance(arr, (Array, ChunkedArray)):
 */
  __pyx_t_1 = PyList_Check(__pyx_v_arr); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":357
 * 
 *     if isinstance(arr, list):
 *         arr = chunked_array(arr)             # <<<<<<<<<<<<<<
 *     elif not isinstance(arr, (Array, ChunkedArray)):
 *         arr = array(arr)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_chunked_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 357, __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_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_arr);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":356
 *         shared_ptr[CColumn] sp_column
 * 
 *     if isinstance(arr, list):             # <<<<<<<<<<<<<<
 *         arr = chunked_array(arr)
 *     elif not isinstance(arr, (Array, ChunkedArray)):
 */
    goto __pyx_L3;
  }

  /* "pyarrow/table.pxi":358
 *     if isinstance(arr, list):
 *         arr = chunked_array(arr)
 *     elif not isinstance(arr, (Array, ChunkedArray)):             # <<<<<<<<<<<<<<
 *         arr = array(arr)
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_arr, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (!__pyx_t_6) {
  } else {
    __pyx_t_2 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = __Pyx_TypeCheck(__pyx_v_arr, __pyx_ptype_7pyarrow_3lib_ChunkedArray); 
  __pyx_t_1 = (__pyx_t_6 != 0);
  __pyx_t_2 = __pyx_t_1;
  __pyx_L4_bool_binop_done:;
  __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":359
 *         arr = chunked_array(arr)
 *     elif not isinstance(arr, (Array, ChunkedArray)):
 *         arr = array(arr)             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(field_or_name, Field):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 359, __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_arr) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_arr);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_arr, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":358
 *     if isinstance(arr, list):
 *         arr = chunked_array(arr)
 *     elif not isinstance(arr, (Array, ChunkedArray)):             # <<<<<<<<<<<<<<
 *         arr = array(arr)
 * 
 */
  }
  __pyx_L3:;

  /* "pyarrow/table.pxi":361
 *         arr = array(arr)
 * 
 *     if isinstance(field_or_name, Field):             # <<<<<<<<<<<<<<
 *         boxed_field = field_or_name
 *         if arr.type != boxed_field.type:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_field_or_name, __pyx_ptype_7pyarrow_3lib_Field); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":362
 * 
 *     if isinstance(field_or_name, Field):
 *         boxed_field = field_or_name             # <<<<<<<<<<<<<<
 *         if arr.type != boxed_field.type:
 *             raise ValueError('Passed field type does not match array')
 */
    if (!(likely(((__pyx_v_field_or_name) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_field_or_name, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(10, 362, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_field_or_name;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_boxed_field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":363
 *     if isinstance(field_or_name, Field):
 *         boxed_field = field_or_name
 *         if arr.type != boxed_field.type:             # <<<<<<<<<<<<<<
 *             raise ValueError('Passed field type does not match array')
 *     else:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_v_boxed_field->type), Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 363, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(10, 363, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":364
 *         boxed_field = field_or_name
 *         if arr.type != boxed_field.type:
 *             raise ValueError('Passed field type does not match array')             # <<<<<<<<<<<<<<
 *     else:
 *         boxed_field = field(field_or_name, arr.type)
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 364, __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(10, 364, __pyx_L1_error)

      /* "pyarrow/table.pxi":363
 *     if isinstance(field_or_name, Field):
 *         boxed_field = field_or_name
 *         if arr.type != boxed_field.type:             # <<<<<<<<<<<<<<
 *             raise ValueError('Passed field type does not match array')
 *     else:
 */
    }

    /* "pyarrow/table.pxi":361
 *         arr = array(arr)
 * 
 *     if isinstance(field_or_name, Field):             # <<<<<<<<<<<<<<
 *         boxed_field = field_or_name
 *         if arr.type != boxed_field.type:
 */
    goto __pyx_L6;
  }

  /* "pyarrow/table.pxi":366
 *             raise ValueError('Passed field type does not match array')
 *     else:
 *         boxed_field = field(field_or_name, arr.type)             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(arr, Array):
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_field); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_arr, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(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_v_field_or_name, __pyx_t_5};
      __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(10, 366, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_field_or_name, __pyx_t_5};
      __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(10, 366, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 366, __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_INCREF(__pyx_v_field_or_name);
      __Pyx_GIVEREF(__pyx_v_field_or_name);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_field_or_name);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 366, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_Field))))) __PYX_ERR(10, 366, __pyx_L1_error)
    __pyx_v_boxed_field = ((struct __pyx_obj_7pyarrow_3lib_Field *)__pyx_t_4);
    __pyx_t_4 = 0;
  }
  __pyx_L6:;

  /* "pyarrow/table.pxi":368
 *         boxed_field = field(field_or_name, arr.type)
 * 
 *     if isinstance(arr, Array):             # <<<<<<<<<<<<<<
 *         _arr = arr
 *         sp_column.reset(new CColumn(boxed_field.sp_field, _arr.sp_array))
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_arr, __pyx_ptype_7pyarrow_3lib_Array); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":369
 * 
 *     if isinstance(arr, Array):
 *         _arr = arr             # <<<<<<<<<<<<<<
 *         sp_column.reset(new CColumn(boxed_field.sp_field, _arr.sp_array))
 *     elif isinstance(arr, ChunkedArray):
 */
    if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(10, 369, __pyx_L1_error)
    __pyx_t_4 = __pyx_v_arr;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v__arr = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":370
 *     if isinstance(arr, Array):
 *         _arr = arr
 *         sp_column.reset(new CColumn(boxed_field.sp_field, _arr.sp_array))             # <<<<<<<<<<<<<<
 *     elif isinstance(arr, ChunkedArray):
 *         _carr = arr
 */
    __pyx_v_sp_column.reset(new  arrow::Column(__pyx_v_boxed_field->sp_field, __pyx_v__arr->sp_array));

    /* "pyarrow/table.pxi":368
 *         boxed_field = field(field_or_name, arr.type)
 * 
 *     if isinstance(arr, Array):             # <<<<<<<<<<<<<<
 *         _arr = arr
 *         sp_column.reset(new CColumn(boxed_field.sp_field, _arr.sp_array))
 */
    goto __pyx_L8;
  }

  /* "pyarrow/table.pxi":371
 *         _arr = arr
 *         sp_column.reset(new CColumn(boxed_field.sp_field, _arr.sp_array))
 *     elif isinstance(arr, ChunkedArray):             # <<<<<<<<<<<<<<
 *         _carr = arr
 *         sp_column.reset(new CColumn(boxed_field.sp_field,
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_arr, __pyx_ptype_7pyarrow_3lib_ChunkedArray); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (likely(__pyx_t_2)) {

    /* "pyarrow/table.pxi":372
 *         sp_column.reset(new CColumn(boxed_field.sp_field, _arr.sp_array))
 *     elif isinstance(arr, ChunkedArray):
 *         _carr = arr             # <<<<<<<<<<<<<<
 *         sp_column.reset(new CColumn(boxed_field.sp_field,
 *                                     _carr.sp_chunked_array))
 */
    if (!(likely(((__pyx_v_arr) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_arr, __pyx_ptype_7pyarrow_3lib_ChunkedArray))))) __PYX_ERR(10, 372, __pyx_L1_error)
    __pyx_t_4 = __pyx_v_arr;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v__carr = ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":373
 *     elif isinstance(arr, ChunkedArray):
 *         _carr = arr
 *         sp_column.reset(new CColumn(boxed_field.sp_field,             # <<<<<<<<<<<<<<
 *                                     _carr.sp_chunked_array))
 *     else:
 */
    __pyx_v_sp_column.reset(new  arrow::Column(__pyx_v_boxed_field->sp_field, __pyx_v__carr->sp_chunked_array));

    /* "pyarrow/table.pxi":371
 *         _arr = arr
 *         sp_column.reset(new CColumn(boxed_field.sp_field, _arr.sp_array))
 *     elif isinstance(arr, ChunkedArray):             # <<<<<<<<<<<<<<
 *         _carr = arr
 *         sp_column.reset(new CColumn(boxed_field.sp_field,
 */
    goto __pyx_L8;
  }

  /* "pyarrow/table.pxi":376
 *                                     _carr.sp_chunked_array))
 *     else:
 *         raise ValueError("Unsupported type for column(...): {}"             # <<<<<<<<<<<<<<
 *                          .format(type(arr)))
 * 
 */
  /*else*/ {

    /* "pyarrow/table.pxi":377
 *     else:
 *         raise ValueError("Unsupported type for column(...): {}"
 *                          .format(type(arr)))             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_column(sp_column)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unsupported_type_for_column, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(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_4 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, ((PyObject *)Py_TYPE(__pyx_v_arr))) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)Py_TYPE(__pyx_v_arr)));
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "pyarrow/table.pxi":376
 *                                     _carr.sp_chunked_array))
 *     else:
 *         raise ValueError("Unsupported type for column(...): {}"             # <<<<<<<<<<<<<<
 *                          .format(type(arr)))
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 376, __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(10, 376, __pyx_L1_error)
  }
  __pyx_L8:;

  /* "pyarrow/table.pxi":379
 *                          .format(type(arr)))
 * 
 *     return pyarrow_wrap_column(sp_column)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_column(__pyx_v_sp_column); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":337
 * 
 * 
 * def column(object field_or_name, arr):             # <<<<<<<<<<<<<<
 *     """
 *     Create Column object from field/string and array-like data
 */

  /* 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_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyarrow.lib.column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_boxed_field);
  __Pyx_XDECREF((PyObject *)__pyx_v__arr);
  __Pyx_XDECREF((PyObject *)__pyx_v__carr);
  __Pyx_XDECREF(__pyx_v_arr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":391
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.column = NULL
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_6Column_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_6Column_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_6Column___cinit__(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_3lib_6Column___cinit__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/table.pxi":392
 * 
 *     def __cinit__(self):
 *         self.column = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  __pyx_v_self->column = NULL;

  /* "pyarrow/table.pxi":391
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.column = NULL
 * 
 */

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

/* "pyarrow/table.pxi":394
 *         self.column = NULL
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Column's constructor directly, use one "
 *                         "of the `Column.from_*` functions instead.")
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_6Column_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_6Column_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_6Column_2__init__(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_3lib_6Column_2__init__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyarrow/table.pxi":395
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Column's constructor directly, use one "             # <<<<<<<<<<<<<<
 *                         "of the `Column.from_*` functions instead.")
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 395, __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, 395, __pyx_L1_error)

  /* "pyarrow/table.pxi":394
 *         self.column = NULL
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         raise TypeError("Do not call Column's constructor directly, use one "
 *                         "of the `Column.from_*` functions instead.")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Column.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":398
 *                         "of the `Column.from_*` functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CColumn]& column):             # <<<<<<<<<<<<<<
 *         self.sp_column = column
 *         self.column = column.get()
 */

static void __pyx_f_7pyarrow_3lib_6Column_init(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, std::shared_ptr< arrow::Column>  const &__pyx_v_column) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init", 0);

  /* "pyarrow/table.pxi":399
 * 
 *     cdef void init(self, const shared_ptr[CColumn]& column):
 *         self.sp_column = column             # <<<<<<<<<<<<<<
 *         self.column = column.get()
 * 
 */
  __pyx_v_self->sp_column = __pyx_v_column;

  /* "pyarrow/table.pxi":400
 *     cdef void init(self, const shared_ptr[CColumn]& column):
 *         self.sp_column = column
 *         self.column = column.get()             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
  __pyx_v_self->column = __pyx_v_column.get();

  /* "pyarrow/table.pxi":398
 *                         "of the `Column.from_*` functions instead.")
 * 
 *     cdef void init(self, const shared_ptr[CColumn]& column):             # <<<<<<<<<<<<<<
 *         self.sp_column = column
 *         self.column = column.get()
 */

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

/* "pyarrow/table.pxi":402
 *         self.column = column.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return column, (self.field, self.data)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_4__reduce__[] = "Column.__reduce__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_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_6Column_4__reduce__(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Column_4__reduce__(struct __pyx_obj_7pyarrow_3lib_Column *__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":403
 * 
 *     def __reduce__(self):
 *         return column, (self.field, self.data)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_column); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_field); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 403, __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(10, 403, __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":402
 *         self.column = column.get()
 * 
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 *         return column, (self.field, self.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_4);
  __Pyx_AddTraceback("pyarrow.lib.Column.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":405
 *         return column, (self.field, self.data)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         from pyarrow.compat import StringIO
 *         result = StringIO()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_7__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Column_6__repr__(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Column_6__repr__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self) {
  PyObject *__pyx_v_StringIO = NULL;
  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;
  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;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/table.pxi":406
 * 
 *     def __repr__(self):
 *         from pyarrow.compat import StringIO             # <<<<<<<<<<<<<<
 *         result = StringIO()
 *         result.write('<Column name={0!r} type={1!r}>'
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_StringIO);
  __Pyx_GIVEREF(__pyx_n_s_StringIO);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_StringIO);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 406, __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_StringIO); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_StringIO = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":407
 *     def __repr__(self):
 *         from pyarrow.compat import StringIO
 *         result = StringIO()             # <<<<<<<<<<<<<<
 *         result.write('<Column name={0!r} type={1!r}>'
 *                      .format(self.name, self.type))
 */
  __Pyx_INCREF(__pyx_v_StringIO);
  __pyx_t_1 = __pyx_v_StringIO; __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(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(10, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":408
 *         from pyarrow.compat import StringIO
 *         result = StringIO()
 *         result.write('<Column name={0!r} type={1!r}>'             # <<<<<<<<<<<<<<
 *                      .format(self.name, self.type))
 *         result.write('\n{}'.format(str(self.data)))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/table.pxi":409
 *         result = StringIO()
 *         result.write('<Column name={0!r} type={1!r}>'
 *                      .format(self.name, self.type))             # <<<<<<<<<<<<<<
 *         result.write('\n{}'.format(str(self.data)))
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Column_name_0_r_type_1_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 409, __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_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_8 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 409, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 409, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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(10, 409, __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_5);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 409, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __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_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __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_2)) __PYX_ERR(10, 408, __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":410
 *         result.write('<Column name={0!r} type={1!r}>'
 *                      .format(self.name, self.type))
 *         result.write('\n{}'.format(str(self.data)))             # <<<<<<<<<<<<<<
 * 
 *         return result.getvalue()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s__103, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_data); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 410, __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_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_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __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_2)) __PYX_ERR(10, 410, __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":412
 *         result.write('\n{}'.format(str(self.data)))
 * 
 *         return result.getvalue()             # <<<<<<<<<<<<<<
 * 
 *     def __richcmp__(Column self, Column other, int op):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_getvalue); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 412, __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(10, 412, __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":405
 *         return column, (self.field, self.data)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         from pyarrow.compat import StringIO
 *         result = StringIO()
 */

  /* 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_9);
  __Pyx_AddTraceback("pyarrow.lib.Column.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_StringIO);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":414
 *         return result.getvalue()
 * 
 *     def __richcmp__(Column self, Column other, int op):             # <<<<<<<<<<<<<<
 *         if op == cp.Py_EQ:
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_9__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_9__richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_7pyarrow_3lib_Column, 1, "other", 0))) __PYX_ERR(10, 414, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Column_8__richcmp__(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_other), ((int)__pyx_v_op));

  /* 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_6Column_8__richcmp__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_other, int __pyx_v_op) {
  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("__richcmp__", 0);

  /* "pyarrow/table.pxi":415
 * 
 *     def __richcmp__(Column self, Column other, int op):
 *         if op == cp.Py_EQ:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         elif op == cp.Py_NE:
 */
  __pyx_t_1 = ((__pyx_v_op == Py_EQ) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/table.pxi":416
 *     def __richcmp__(Column self, Column other, int op):
 *         if op == cp.Py_EQ:
 *             return self.equals(other)             # <<<<<<<<<<<<<<
 *         elif op == cp.Py_NE:
 *             return not self.equals(other)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 416, __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, ((PyObject *)__pyx_v_other)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 416, __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":415
 * 
 *     def __richcmp__(Column self, Column other, int op):
 *         if op == cp.Py_EQ:             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         elif op == cp.Py_NE:
 */
  }

  /* "pyarrow/table.pxi":417
 *         if op == cp.Py_EQ:
 *             return self.equals(other)
 *         elif op == cp.Py_NE:             # <<<<<<<<<<<<<<
 *             return not self.equals(other)
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_op == Py_NE) != 0);
  if (likely(__pyx_t_1)) {

    /* "pyarrow/table.pxi":418
 *             return self.equals(other)
 *         elif op == cp.Py_NE:
 *             return not self.equals(other)             # <<<<<<<<<<<<<<
 *         else:
 *             raise TypeError('Invalid comparison')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_equals); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 418, __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, ((PyObject *)__pyx_v_other)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(10, 418, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyBool_FromLong((!__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":417
 *         if op == cp.Py_EQ:
 *             return self.equals(other)
 *         elif op == cp.Py_NE:             # <<<<<<<<<<<<<<
 *             return not self.equals(other)
 *         else:
 */
  }

  /* "pyarrow/table.pxi":420
 *             return not self.equals(other)
 *         else:
 *             raise TypeError('Invalid comparison')             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 420, __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(10, 420, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":414
 *         return result.getvalue()
 * 
 *     def __richcmp__(Column self, Column other, int op):             # <<<<<<<<<<<<<<
 *         if op == cp.Py_EQ:
 *             return self.equals(other)
 */

  /* 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.Column.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":422
 *             raise TypeError('Invalid comparison')
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         return self.data[key]
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_11__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_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_6Column_10__getitem__(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Column_10__getitem__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/table.pxi":423
 * 
 *     def __getitem__(self, key):
 *         return self.data[key]             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 423, __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":422
 *             raise TypeError('Invalid comparison')
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         return self.data[key]
 * 
 */

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

/* "pyarrow/table.pxi":426
 * 
 *     @staticmethod
 *     def from_array(*args):             # <<<<<<<<<<<<<<
 *         return column(*args)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_13from_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_12from_array[] = "Column.from_array(*args)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_6Column_13from_array = {"from_array", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Column_13from_array, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Column_12from_array};
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_13from_array(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_array (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "from_array", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Column_12from_array(__pyx_self, __pyx_v_args);

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Column_12from_array(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("from_array", 0);

  /* "pyarrow/table.pxi":427
 *     @staticmethod
 *     def from_array(*args):
 *         return column(*args)             # <<<<<<<<<<<<<<
 * 
 *     def cast(self, object target_type, bint safe=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_column); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 427, __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":426
 * 
 *     @staticmethod
 *     def from_array(*args):             # <<<<<<<<<<<<<<
 *         return column(*args)
 * 
 */

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

/* "pyarrow/table.pxi":429
 *         return column(*args)
 * 
 *     def cast(self, object target_type, bint safe=True):             # <<<<<<<<<<<<<<
 *         """
 *         Cast column values to another data type
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_15cast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_14cast[] = "Column.cast(self, target_type, bool safe=True)\n\n        Cast column 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 : Column\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_15cast(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(10, 429, __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(10, 429, __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(10, 429, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Column.cast", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Column_14cast(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self), __pyx_v_target_type, __pyx_v_safe);

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Column_14cast(struct __pyx_obj_7pyarrow_3lib_Column *__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_v_casted_data = 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;
  __Pyx_RefNannySetupContext("cast", 0);

  /* "pyarrow/table.pxi":445
 *         """
 *         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":446
 *         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)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 446, __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":450
 *             CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Cast(_context(), CDatum(self.column.data()),
 *                               type.sp_type, options, &out))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":451
 * 
 *         with nogil:
 *             check_status(Cast(_context(), CDatum(self.column.data()),             # <<<<<<<<<<<<<<
 *                               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->column->data()), __pyx_v_type->sp_type, __pyx_v_options, (&__pyx_v_out))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(10, 451, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":450
 *             CDatum out
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(Cast(_context(), CDatum(self.column.data()),
 *                               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":454
 *                               type.sp_type, options, &out))
 * 
 *         casted_data = pyarrow_wrap_chunked_array(out.chunked_array())             # <<<<<<<<<<<<<<
 *         return column(self.name, casted_data)
 * 
 */
  __pyx_t_1 = pyarrow_wrap_chunked_array(__pyx_v_out.chunked_array()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_casted_data = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":455
 * 
 *         casted_data = pyarrow_wrap_chunked_array(out.chunked_array())
 *         return column(self.name, casted_data)             # <<<<<<<<<<<<<<
 * 
 *     def dictionary_encode(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_column); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_2 = 0;
  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 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_v_casted_data};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 455, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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_v_casted_data};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_2, 2+__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 455, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_2, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_casted_data);
    __Pyx_GIVEREF(__pyx_v_casted_data);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_2, __pyx_v_casted_data);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":429
 *         return column(*args)
 * 
 *     def cast(self, object target_type, bint safe=True):             # <<<<<<<<<<<<<<
 *         """
 *         Cast column values to another data type
 */

  /* 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_AddTraceback("pyarrow.lib.Column.cast", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_type);
  __Pyx_XDECREF(__pyx_v_casted_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":457
 *         return column(self.name, casted_data)
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute dictionary-encoded representation of array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_17dictionary_encode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_16dictionary_encode[] = "Column.dictionary_encode(self)\n\n        Compute dictionary-encoded representation of array\n\n        Returns\n        -------\n        pyarrow.Column\n            Same chunking as the input, all chunks share a common dictionary.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_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_6Column_16dictionary_encode(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Column_16dictionary_encode(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self) {
  PyObject *__pyx_v_ca = 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("dictionary_encode", 0);

  /* "pyarrow/table.pxi":466
 *             Same chunking as the input, all chunks share a common dictionary.
 *         """
 *         ca = self.data.dictionary_encode()             # <<<<<<<<<<<<<<
 *         return column(self.name, ca)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dictionary_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 466, __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(10, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_ca = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":467
 *         """
 *         ca = self.data.dictionary_encode()
 *         return column(self.name, ca)             # <<<<<<<<<<<<<<
 * 
 *     def unique(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_column); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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, __pyx_t_2, __pyx_v_ca};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 467, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_ca};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 467, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 467, __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_2);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2);
    __Pyx_INCREF(__pyx_v_ca);
    __Pyx_GIVEREF(__pyx_v_ca);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_ca);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":457
 *         return column(self.name, casted_data)
 * 
 *     def dictionary_encode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute dictionary-encoded representation of 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_AddTraceback("pyarrow.lib.Column.dictionary_encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ca);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":469
 *         return column(self.name, ca)
 * 
 *     def unique(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute distinct elements in array
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_19unique(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_18unique[] = "Column.unique(self)\n\n        Compute distinct elements in array\n\n        Returns\n        -------\n        pyarrow.Array\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_19unique(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_6Column_18unique(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Column_18unique(struct __pyx_obj_7pyarrow_3lib_Column *__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("unique", 0);

  /* "pyarrow/table.pxi":477
 *         pyarrow.Array
 *         """
 *         return self.data.unique()             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self, MemoryPool memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unique); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 477, __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(10, 477, __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":469
 *         return column(self.name, ca)
 * 
 *     def unique(self):             # <<<<<<<<<<<<<<
 *         """
 *         Compute distinct elements in 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.Column.unique", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":479
 *         return self.data.unique()
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this Column.  If it has a struct type, the column is
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_21flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_20flatten[] = "Column.flatten(self, MemoryPool memory_pool=None)\n\n        Flatten this Column.  If it has a struct type, the column is\n        flattened into one column 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[Column]\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_21flatten(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(10, 479, __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(10, 479, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Column.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(10, 479, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Column_20flatten(((struct __pyx_obj_7pyarrow_3lib_Column *)__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_6Column_20flatten(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool) {
  std::vector<std::shared_ptr< arrow::Column> >  __pyx_v_flattened;
   arrow::MemoryPool *__pyx_v_pool;
  std::shared_ptr< arrow::Column>  __pyx_v_col;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::vector<std::shared_ptr< arrow::Column> > ::iterator __pyx_t_3;
  std::shared_ptr< arrow::Column>  __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("flatten", 0);

  /* "pyarrow/table.pxi":495
 *         cdef:
 *             vector[shared_ptr[CColumn]] 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":497
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.column.Flatten(pool, &flattened))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":498
 * 
 *         with nogil:
 *             check_status(self.column.Flatten(pool, &flattened))             # <<<<<<<<<<<<<<
 * 
 *         return [pyarrow_wrap_column(col) for col in flattened]
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->column->Flatten(__pyx_v_pool, (&__pyx_v_flattened))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 498, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":497
 *             CMemoryPool* pool = maybe_unbox_memory_pool(memory_pool)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.column.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":500
 *             check_status(self.column.Flatten(pool, &flattened))
 * 
 *         return [pyarrow_wrap_column(col) for col in flattened]             # <<<<<<<<<<<<<<
 * 
 *     def to_pandas(self, bint strings_to_categorical=False,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 500, __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_v_col = __pyx_t_4;
    __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_column(__pyx_v_col); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(10, 500, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":479
 *         return self.data.unique()
 * 
 *     def flatten(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Flatten this Column.  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.Column.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":502
 *         return [pyarrow_wrap_column(col) for col in flattened]
 * 
 *     def to_pandas(self, bint strings_to_categorical=False,             # <<<<<<<<<<<<<<
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,
 *                   bint date_as_object=False):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_23to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_22to_pandas[] = "Column.to_pandas(self, bool strings_to_categorical=False, bool zero_copy_only=False, bool integer_object_nulls=False, bool date_as_object=False)\n\n        Convert the arrow::Column to a pandas.Series\n\n        Parameters\n        ----------\n        strings_to_categorical : boolean, default False\n            Encode string (UTF8) and binary types to pandas.Categorical\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\n        Returns\n        -------\n        pandas.Series\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_23to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_strings_to_categorical;
  int __pyx_v_zero_copy_only;
  int __pyx_v_integer_object_nulls;
  int __pyx_v_date_as_object;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_strings_to_categorical,&__pyx_n_s_zero_copy_only,&__pyx_n_s_integer_object_nulls,&__pyx_n_s_date_as_object,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 (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_strings_to_categorical);
          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_zero_copy_only);
          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_integer_object_nulls);
          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_date_as_object);
          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(10, 502, __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);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_strings_to_categorical = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_strings_to_categorical == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 502, __pyx_L3_error)
    } else {
      __pyx_v_strings_to_categorical = ((int)0);
    }
    if (values[1]) {
      __pyx_v_zero_copy_only = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_zero_copy_only == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 503, __pyx_L3_error)
    } else {

      /* "pyarrow/table.pxi":503
 * 
 *     def to_pandas(self, bint strings_to_categorical=False,
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,             # <<<<<<<<<<<<<<
 *                   bint date_as_object=False):
 *         """
 */
      __pyx_v_zero_copy_only = ((int)0);
    }
    if (values[2]) {
      __pyx_v_integer_object_nulls = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_integer_object_nulls == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 503, __pyx_L3_error)
    } else {
      __pyx_v_integer_object_nulls = ((int)0);
    }
    if (values[3]) {
      __pyx_v_date_as_object = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_date_as_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 504, __pyx_L3_error)
    } else {

      /* "pyarrow/table.pxi":504
 *     def to_pandas(self, bint strings_to_categorical=False,
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,
 *                   bint date_as_object=False):             # <<<<<<<<<<<<<<
 *         """
 *         Convert the arrow::Column to a pandas.Series
 */
      __pyx_v_date_as_object = ((int)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_pandas", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 502, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Column.to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Column_22to_pandas(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self), __pyx_v_strings_to_categorical, __pyx_v_zero_copy_only, __pyx_v_integer_object_nulls, __pyx_v_date_as_object);

  /* "pyarrow/table.pxi":502
 *         return [pyarrow_wrap_column(col) for col in flattened]
 * 
 *     def to_pandas(self, bint strings_to_categorical=False,             # <<<<<<<<<<<<<<
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,
 *                   bint date_as_object=False):
 */

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Column_22to_pandas(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, int __pyx_v_strings_to_categorical, int __pyx_v_zero_copy_only, int __pyx_v_integer_object_nulls, int __pyx_v_date_as_object) {
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_tz = 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;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("to_pandas", 0);

  /* "pyarrow/table.pxi":524
 *         pandas.Series
 *         """
 *         values = self.data.to_pandas(             # <<<<<<<<<<<<<<
 *             strings_to_categorical=strings_to_categorical,
 *             zero_copy_only=zero_copy_only,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_to_pandas); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":525
 *         """
 *         values = self.data.to_pandas(
 *             strings_to_categorical=strings_to_categorical,             # <<<<<<<<<<<<<<
 *             zero_copy_only=zero_copy_only,
 *             date_as_object=date_as_object,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_strings_to_categorical); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_strings_to_categorical, __pyx_t_3) < 0) __PYX_ERR(10, 525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":526
 *         values = self.data.to_pandas(
 *             strings_to_categorical=strings_to_categorical,
 *             zero_copy_only=zero_copy_only,             # <<<<<<<<<<<<<<
 *             date_as_object=date_as_object,
 *             integer_object_nulls=integer_object_nulls)
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_zero_copy_only); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_zero_copy_only, __pyx_t_3) < 0) __PYX_ERR(10, 525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":527
 *             strings_to_categorical=strings_to_categorical,
 *             zero_copy_only=zero_copy_only,
 *             date_as_object=date_as_object,             # <<<<<<<<<<<<<<
 *             integer_object_nulls=integer_object_nulls)
 *         result = pd.Series(values, name=self.name)
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_date_as_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_date_as_object, __pyx_t_3) < 0) __PYX_ERR(10, 525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":528
 *             zero_copy_only=zero_copy_only,
 *             date_as_object=date_as_object,
 *             integer_object_nulls=integer_object_nulls)             # <<<<<<<<<<<<<<
 *         result = pd.Series(values, name=self.name)
 * 
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_integer_object_nulls); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_integer_object_nulls, __pyx_t_3) < 0) __PYX_ERR(10, 525, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":524
 *         pandas.Series
 *         """
 *         values = self.data.to_pandas(             # <<<<<<<<<<<<<<
 *             strings_to_categorical=strings_to_categorical,
 *             zero_copy_only=zero_copy_only,
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 524, __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_values = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":529
 *             date_as_object=date_as_object,
 *             integer_object_nulls=integer_object_nulls)
 *         result = pd.Series(values, name=self.name)             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(self.type, TimestampType):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pd); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Series); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_values);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name_2, __pyx_t_4) < 0) __PYX_ERR(10, 529, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 529, __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pyarrow/table.pxi":531
 *         result = pd.Series(values, name=self.name)
 * 
 *         if isinstance(self.type, TimestampType):             # <<<<<<<<<<<<<<
 *             tz = self.type.tz
 *             if tz is not None:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_TypeCheck(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_TimestampType); 
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "pyarrow/table.pxi":532
 * 
 *         if isinstance(self.type, TimestampType):
 *             tz = self.type.tz             # <<<<<<<<<<<<<<
 *             if tz is not None:
 *                 tz = string_to_tzinfo(tz)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_tz); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_tz = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/table.pxi":533
 *         if isinstance(self.type, TimestampType):
 *             tz = self.type.tz
 *             if tz is not None:             # <<<<<<<<<<<<<<
 *                 tz = string_to_tzinfo(tz)
 *                 result = (result.dt.tz_localize('utc')
 */
    __pyx_t_6 = (__pyx_v_tz != Py_None);
    __pyx_t_5 = (__pyx_t_6 != 0);
    if (__pyx_t_5) {

      /* "pyarrow/table.pxi":534
 *             tz = self.type.tz
 *             if tz is not None:
 *                 tz = string_to_tzinfo(tz)             # <<<<<<<<<<<<<<
 *                 result = (result.dt.tz_localize('utc')
 *                           .dt.tz_convert(tz))
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_string_to_tzinfo); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_tz) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_tz);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 534, __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/table.pxi":535
 *             if tz is not None:
 *                 tz = string_to_tzinfo(tz)
 *                 result = (result.dt.tz_localize('utc')             # <<<<<<<<<<<<<<
 *                           .dt.tz_convert(tz))
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_result, __pyx_n_s_dt); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tz_localize); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __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_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_n_s_utc) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_n_s_utc);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "pyarrow/table.pxi":536
 *                 tz = string_to_tzinfo(tz)
 *                 result = (result.dt.tz_localize('utc')
 *                           .dt.tz_convert(tz))             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_dt); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 536, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_tz_convert); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 536, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(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_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_v_tz) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_tz);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 536, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "pyarrow/table.pxi":533
 *         if isinstance(self.type, TimestampType):
 *             tz = self.type.tz
 *             if tz is not None:             # <<<<<<<<<<<<<<
 *                 tz = string_to_tzinfo(tz)
 *                 result = (result.dt.tz_localize('utc')
 */
    }

    /* "pyarrow/table.pxi":531
 *         result = pd.Series(values, name=self.name)
 * 
 *         if isinstance(self.type, TimestampType):             # <<<<<<<<<<<<<<
 *             tz = self.type.tz
 *             if tz is not None:
 */
  }

  /* "pyarrow/table.pxi":538
 *                           .dt.tz_convert(tz))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def __array__(self, dtype=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":502
 *         return [pyarrow_wrap_column(col) for col in flattened]
 * 
 *     def to_pandas(self, bint strings_to_categorical=False,             # <<<<<<<<<<<<<<
 *                   bint zero_copy_only=False, bint integer_object_nulls=False,
 *                   bint date_as_object=False):
 */

  /* 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.Column.to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_tz);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":540
 *         return result
 * 
 *     def __array__(self, dtype=None):             # <<<<<<<<<<<<<<
 *         return self.data.__array__(dtype=dtype)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_25__array__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_24__array__[] = "Column.__array__(self, dtype=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_25__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(10, 540, __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(10, 540, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.Column.__array__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Column_24__array__(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self), __pyx_v_dtype);

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Column_24__array__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, PyObject *__pyx_v_dtype) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__array__", 0);

  /* "pyarrow/table.pxi":541
 * 
 *     def __array__(self, dtype=None):
 *         return self.data.__array__(dtype=dtype)             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, Column other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 541, __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(10, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_dtype) < 0) __PYX_ERR(10, 541, __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(10, 541, __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":540
 *         return result
 * 
 *     def __array__(self, dtype=None):             # <<<<<<<<<<<<<<
 *         return self.data.__array__(dtype=dtype)
 * 
 */

  /* 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.Column.__array__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":543
 *         return self.data.__array__(dtype=dtype)
 * 
 *     def equals(self, Column other):             # <<<<<<<<<<<<<<
 *         """
 *         Check if contents of two columns are equal
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_27equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_26equals[] = "Column.equals(self, Column other)\n\n        Check if contents of two columns are equal\n\n        Parameters\n        ----------\n        other : pyarrow.Column\n\n        Returns\n        -------\n        are_equal : boolean\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_27equals(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_Column, 1, "other", 0))) __PYX_ERR(10, 543, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Column_26equals(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Column *)__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_6Column_26equals(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_other) {
   arrow::Column *__pyx_v_this_col;
   arrow::Column *__pyx_v_other_col;
  bool __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
   arrow::Column *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/table.pxi":556
 *         """
 *         cdef:
 *             CColumn* this_col = self.column             # <<<<<<<<<<<<<<
 *             CColumn* other_col = other.column
 *             c_bool result
 */
  __pyx_t_1 = __pyx_v_self->column;
  __pyx_v_this_col = __pyx_t_1;

  /* "pyarrow/table.pxi":557
 *         cdef:
 *             CColumn* this_col = self.column
 *             CColumn* other_col = other.column             # <<<<<<<<<<<<<<
 *             c_bool result
 * 
 */
  __pyx_t_1 = __pyx_v_other->column;
  __pyx_v_other_col = __pyx_t_1;

  /* "pyarrow/table.pxi":560
 *             c_bool result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_col.Equals(deref(other_col))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":561
 * 
 *         with nogil:
 *             result = this_col.Equals(deref(other_col))             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
        __pyx_v_result = __pyx_v_this_col->Equals((*__pyx_v_other_col));
      }

      /* "pyarrow/table.pxi":560
 *             c_bool result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_col.Equals(deref(other_col))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":563
 *             result = this_col.Equals(deref(other_col))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def to_pylist(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":543
 *         return self.data.__array__(dtype=dtype)
 * 
 *     def equals(self, Column other):             # <<<<<<<<<<<<<<
 *         """
 *         Check if contents of two columns are equal
 */

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

/* "pyarrow/table.pxi":565
 *         return result
 * 
 *     def to_pylist(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert to a list of native Python objects.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_29to_pylist(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_28to_pylist[] = "Column.to_pylist(self)\n\n        Convert to a list of native Python objects.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_29to_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_6Column_28to_pylist(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Column_28to_pylist(struct __pyx_obj_7pyarrow_3lib_Column *__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("to_pylist", 0);

  /* "pyarrow/table.pxi":569
 *         Convert to a list of native Python objects.
 *         """
 *         return self.data.to_pylist()             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_to_pylist); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 569, __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(10, 569, __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":565
 *         return result
 * 
 *     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_3);
  __Pyx_AddTraceback("pyarrow.lib.Column.to_pylist", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":571
 *         return self.data.to_pylist()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.length()
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Column_31__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Column_31__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Column_30__len__(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_7pyarrow_3lib_6Column_30__len__(struct __pyx_obj_7pyarrow_3lib_Column *__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":572
 * 
 *     def __len__(self):
 *         return self.length()             # <<<<<<<<<<<<<<
 * 
 *     def length(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 572, __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(10, 572, __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(10, 572, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":571
 *         return self.data.to_pylist()
 * 
 *     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.Column.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":574
 *         return self.length()
 * 
 *     def length(self):             # <<<<<<<<<<<<<<
 *         return self.column.length()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_33length(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Column_32length[] = "Column.length(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_33length(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_6Column_32length(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Column_32length(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("length", 0);

  /* "pyarrow/table.pxi":575
 * 
 *     def length(self):
 *         return self.column.length()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->column->length()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":574
 *         return self.length()
 * 
 *     def length(self):             # <<<<<<<<<<<<<<
 *         return self.column.length()
 * 
 */

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

/* "pyarrow/table.pxi":578
 * 
 *     @property
 *     def field(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_field(self.column.field())
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_5field_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_5field_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Column_5field___get__(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self));

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

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

  /* "pyarrow/table.pxi":579
 *     @property
 *     def field(self):
 *         return pyarrow_wrap_field(self.column.field())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_field(__pyx_v_self->column->field()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":578
 * 
 *     @property
 *     def field(self):             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_field(self.column.field())
 * 
 */

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

/* "pyarrow/table.pxi":582
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         """
 *         Dimensions of this columns
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_5shape_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Column_5shape___get__(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Column_5shape___get__(struct __pyx_obj_7pyarrow_3lib_Column *__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":590
 *         (int,)
 *         """
 *         return (self.length(),)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 590, __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(10, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 590, __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_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":582
 * 
 *     @property
 *     def shape(self):             # <<<<<<<<<<<<<<
 *         """
 *         Dimensions of this 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.Column.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":593
 * 
 *     @property
 *     def null_count(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of null entires
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_10null_count_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_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_6Column_10null_count___get__(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self));

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

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

  /* "pyarrow/table.pxi":601
 *         int
 *         """
 *         return self.column.null_count()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_self->column->null_count()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":593
 * 
 *     @property
 *     def null_count(self):             # <<<<<<<<<<<<<<
 *         """
 *         Number of null entires
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Column.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":604
 * 
 *     @property
 *     def name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Label of the column
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Column_4name___get__(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_6Column_4name___get__(struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyarrow/table.pxi":612
 *         str
 *         """
 *         return bytes(self.column.name()).decode('utf8')             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_self->column->name()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_decode_bytes(__pyx_t_2, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 612, __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":604
 * 
 *     @property
 *     def name(self):             # <<<<<<<<<<<<<<
 *         """
 *         Label of the column
 */

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

/* "pyarrow/table.pxi":615
 * 
 *     @property
 *     def type(self):             # <<<<<<<<<<<<<<
 *         """
 *         Type information for this column
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_4type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_4type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Column_4type___get__(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self));

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

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

  /* "pyarrow/table.pxi":623
 *         pyarrow.DataType
 *         """
 *         return pyarrow_wrap_data_type(self.column.type())             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(__pyx_v_self->column->type()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":615
 * 
 *     @property
 *     def type(self):             # <<<<<<<<<<<<<<
 *         """
 *         Type information for this column
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Column.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":626
 * 
 *     @property
 *     def data(self):             # <<<<<<<<<<<<<<
 *         """
 *         The underlying data
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_4data_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Column_4data_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Column_4data___get__(((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_self));

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

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

  /* "pyarrow/table.pxi":634
 *         pyarrow.ChunkedArray
 *         """
 *         return pyarrow_wrap_chunked_array(self.column.data())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = pyarrow_wrap_chunked_array(__pyx_v_self->column->data()); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":626
 * 
 *     @property
 *     def data(self):             # <<<<<<<<<<<<<<
 *         """
 *         The underlying data
 */

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

/* "pyarrow/table.pxi":637
 * 
 * 
 * cdef shared_ptr[const CKeyValueMetadata] unbox_metadata(dict metadata):             # <<<<<<<<<<<<<<
 *     if metadata is None:
 *         return <shared_ptr[const CKeyValueMetadata]> nullptr
 */

static std::shared_ptr< arrow::KeyValueMetadata const >  __pyx_f_7pyarrow_3lib_unbox_metadata(PyObject *__pyx_v_metadata) {
  std::unordered_map<std::string,std::string>  __pyx_v_unordered_metadata;
  std::shared_ptr< arrow::KeyValueMetadata const >  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  std::unordered_map<std::string,std::string>  __pyx_t_3;
  std::shared_ptr< arrow::KeyValueMetadata>  __pyx_t_4;
  __Pyx_RefNannySetupContext("unbox_metadata", 0);

  /* "pyarrow/table.pxi":638
 * 
 * cdef shared_ptr[const CKeyValueMetadata] unbox_metadata(dict metadata):
 *     if metadata is None:             # <<<<<<<<<<<<<<
 *         return <shared_ptr[const CKeyValueMetadata]> nullptr
 *     cdef:
 */
  __pyx_t_1 = (__pyx_v_metadata == ((PyObject*)Py_None));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":639
 * cdef shared_ptr[const CKeyValueMetadata] unbox_metadata(dict metadata):
 *     if metadata is None:
 *         return <shared_ptr[const CKeyValueMetadata]> nullptr             # <<<<<<<<<<<<<<
 *     cdef:
 *         unordered_map[c_string, c_string] unordered_metadata = metadata
 */
    __pyx_r = ((std::shared_ptr< arrow::KeyValueMetadata const > )nullptr);
    goto __pyx_L0;

    /* "pyarrow/table.pxi":638
 * 
 * cdef shared_ptr[const CKeyValueMetadata] unbox_metadata(dict metadata):
 *     if metadata is None:             # <<<<<<<<<<<<<<
 *         return <shared_ptr[const CKeyValueMetadata]> nullptr
 *     cdef:
 */
  }

  /* "pyarrow/table.pxi":641
 *         return <shared_ptr[const CKeyValueMetadata]> nullptr
 *     cdef:
 *         unordered_map[c_string, c_string] unordered_metadata = metadata             # <<<<<<<<<<<<<<
 *     return (<shared_ptr[const CKeyValueMetadata]>
 *             make_shared[CKeyValueMetadata](unordered_metadata))
 */
  __pyx_t_3 = __pyx_convert_unordered_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_v_metadata); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 641, __pyx_L1_error)
  __pyx_v_unordered_metadata = __pyx_t_3;

  /* "pyarrow/table.pxi":643
 *         unordered_map[c_string, c_string] unordered_metadata = metadata
 *     return (<shared_ptr[const CKeyValueMetadata]>
 *             make_shared[CKeyValueMetadata](unordered_metadata))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_4 = std::make_shared< arrow::KeyValueMetadata>(__pyx_v_unordered_metadata);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(10, 643, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":642
 *     cdef:
 *         unordered_map[c_string, c_string] unordered_metadata = metadata
 *     return (<shared_ptr[const CKeyValueMetadata]>             # <<<<<<<<<<<<<<
 *             make_shared[CKeyValueMetadata](unordered_metadata))
 * 
 */
  __pyx_r = ((std::shared_ptr< arrow::KeyValueMetadata const > )__pyx_t_4);
  goto __pyx_L0;

  /* "pyarrow/table.pxi":637
 * 
 * 
 * cdef shared_ptr[const CKeyValueMetadata] unbox_metadata(dict metadata):             # <<<<<<<<<<<<<<
 *     if metadata is None:
 *         return <shared_ptr[const CKeyValueMetadata]> nullptr
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("pyarrow.lib.unbox_metadata", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":646
 * 
 * 
 * cdef _schema_from_arrays(arrays, names, dict metadata,             # <<<<<<<<<<<<<<
 *                          shared_ptr[CSchema]* schema):
 *     cdef:
 */

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) {
  struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_col = 0;
  std::string __pyx_v_c_name;
  std::vector<std::shared_ptr< arrow::Field> >  __pyx_v_fields;
  std::shared_ptr< arrow::DataType>  __pyx_v_type_;
  Py_ssize_t __pyx_v_K;
  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;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  std::string __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  std::shared_ptr< arrow::DataType>  __pyx_t_15;
  __Pyx_RefNannySetupContext("_schema_from_arrays", 0);

  /* "pyarrow/table.pxi":653
 *         vector[shared_ptr[CField]] fields
 *         shared_ptr[CDataType] type_
 *         Py_ssize_t K = len(arrays)             # <<<<<<<<<<<<<<
 * 
 *     if K == 0:
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arrays); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(10, 653, __pyx_L1_error)
  __pyx_v_K = __pyx_t_1;

  /* "pyarrow/table.pxi":655
 *         Py_ssize_t K = len(arrays)
 * 
 *     if K == 0:             # <<<<<<<<<<<<<<
 *         schema.reset(new CSchema(fields, unbox_metadata(metadata)))
 *         return
 */
  __pyx_t_2 = ((__pyx_v_K == 0) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":656
 * 
 *     if K == 0:
 *         schema.reset(new CSchema(fields, unbox_metadata(metadata)))             # <<<<<<<<<<<<<<
 *         return
 * 
 */
    __pyx_v_schema->reset(new  arrow::Schema(__pyx_v_fields, __pyx_f_7pyarrow_3lib_unbox_metadata(__pyx_v_metadata)));

    /* "pyarrow/table.pxi":657
 *     if K == 0:
 *         schema.reset(new CSchema(fields, unbox_metadata(metadata)))
 *         return             # <<<<<<<<<<<<<<
 * 
 *     fields.resize(K)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/table.pxi":655
 *         Py_ssize_t K = len(arrays)
 * 
 *     if K == 0:             # <<<<<<<<<<<<<<
 *         schema.reset(new CSchema(fields, unbox_metadata(metadata)))
 *         return
 */
  }

  /* "pyarrow/table.pxi":659
 *         return
 * 
 *     fields.resize(K)             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(arrays[0], Column):
 */
  try {
    __pyx_v_fields.resize(__pyx_v_K);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(10, 659, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":661
 *     fields.resize(K)
 * 
 *     if isinstance(arrays[0], Column):             # <<<<<<<<<<<<<<
 *         for i in range(K):
 *             col = arrays[i]
 */
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_arrays, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_t_3, __pyx_ptype_7pyarrow_3lib_Column); 
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = (__pyx_t_2 != 0);
  if (__pyx_t_4) {

    /* "pyarrow/table.pxi":662
 * 
 *     if isinstance(arrays[0], Column):
 *         for i in range(K):             # <<<<<<<<<<<<<<
 *             col = arrays[i]
 *             type_ = col.sp_column.get().type()
 */
    __pyx_t_1 = __pyx_v_K;
    __pyx_t_5 = __pyx_t_1;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "pyarrow/table.pxi":663
 *     if isinstance(arrays[0], Column):
 *         for i in range(K):
 *             col = arrays[i]             # <<<<<<<<<<<<<<
 *             type_ = col.sp_column.get().type()
 *             c_name = tobytes(col.name)
 */
      __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_arrays, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 663, __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_Column))))) __PYX_ERR(10, 663, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_col, ((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "pyarrow/table.pxi":664
 *         for i in range(K):
 *             col = arrays[i]
 *             type_ = col.sp_column.get().type()             # <<<<<<<<<<<<<<
 *             c_name = tobytes(col.name)
 *             fields[i].reset(new CField(c_name, type_, True))
 */
      __pyx_v_type_ = __pyx_v_col->sp_column.get()->type();

      /* "pyarrow/table.pxi":665
 *             col = arrays[i]
 *             type_ = col.sp_column.get().type()
 *             c_name = tobytes(col.name)             # <<<<<<<<<<<<<<
 *             fields[i].reset(new CField(c_name, type_, True))
 *     else:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 665, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_col), __pyx_n_s_name_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 665, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = NULL;
      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_3 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __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_3)) __PYX_ERR(10, 665, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_10 = __pyx_convert_string_from_py_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 665, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_c_name = __pyx_t_10;

      /* "pyarrow/table.pxi":666
 *             type_ = col.sp_column.get().type()
 *             c_name = tobytes(col.name)
 *             fields[i].reset(new CField(c_name, type_, True))             # <<<<<<<<<<<<<<
 *     else:
 *         if names is None:
 */
      (__pyx_v_fields[__pyx_v_i]).reset(new  arrow::Field(__pyx_v_c_name, __pyx_v_type_, 1));
    }

    /* "pyarrow/table.pxi":661
 *     fields.resize(K)
 * 
 *     if isinstance(arrays[0], Column):             # <<<<<<<<<<<<<<
 *         for i in range(K):
 *             col = arrays[i]
 */
    goto __pyx_L4;
  }

  /* "pyarrow/table.pxi":668
 *             fields[i].reset(new CField(c_name, type_, True))
 *     else:
 *         if names is None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Must pass names when constructing '
 *                              'from Array objects')
 */
  /*else*/ {
    __pyx_t_4 = (__pyx_v_names == Py_None);
    __pyx_t_2 = (__pyx_t_4 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":669
 *     else:
 *         if names is None:
 *             raise ValueError('Must pass names when constructing '             # <<<<<<<<<<<<<<
 *                              'from Array objects')
 *         if len(names) != K:
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 669, __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(10, 669, __pyx_L1_error)

      /* "pyarrow/table.pxi":668
 *             fields[i].reset(new CField(c_name, type_, True))
 *     else:
 *         if names is None:             # <<<<<<<<<<<<<<
 *             raise ValueError('Must pass names when constructing '
 *                              'from Array objects')
 */
    }

    /* "pyarrow/table.pxi":671
 *             raise ValueError('Must pass names when constructing '
 *                              'from Array objects')
 *         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(10, 671, __pyx_L1_error)
    __pyx_t_2 = ((__pyx_t_1 != __pyx_v_K) != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":673
 *         if len(names) != K:
 *             raise ValueError('Length of names ({}) does not match '
 *                              'length of arrays ({})'.format(len(names), K))             # <<<<<<<<<<<<<<
 *         for i in range(K):
 *             val = arrays[i]
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Length_of_names_does_not_match_l, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 673, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_1 = PyObject_Length(__pyx_v_names); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(10, 673, __pyx_L1_error)
      __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 673, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_K); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 673, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_11 = NULL;
      __pyx_t_12 = 0;
      if (CYTHON_UNPACK_METHODS && likely(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_12 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_8, __pyx_t_9};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 673, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
        PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_8, __pyx_t_9};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 673, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else
      #endif
      {
        __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(10, 673, __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_8);
        PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, __pyx_t_8);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_t_9);
        __pyx_t_8 = 0;
        __pyx_t_9 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 673, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "pyarrow/table.pxi":672
 *                              'from Array objects')
 *         if len(names) != K:
 *             raise ValueError('Length of names ({}) does not match '             # <<<<<<<<<<<<<<
 *                              'length of arrays ({})'.format(len(names), K))
 *         for i in range(K):
 */
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 672, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_7, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __PYX_ERR(10, 672, __pyx_L1_error)

      /* "pyarrow/table.pxi":671
 *             raise ValueError('Must pass names when constructing '
 *                              'from Array objects')
 *         if len(names) != K:             # <<<<<<<<<<<<<<
 *             raise ValueError('Length of names ({}) does not match '
 *                              'length of arrays ({})'.format(len(names), K))
 */
    }

    /* "pyarrow/table.pxi":674
 *             raise ValueError('Length of names ({}) does not match '
 *                              'length of arrays ({})'.format(len(names), K))
 *         for i in range(K):             # <<<<<<<<<<<<<<
 *             val = arrays[i]
 *             if isinstance(val, (Array, ChunkedArray)):
 */
    __pyx_t_1 = __pyx_v_K;
    __pyx_t_5 = __pyx_t_1;
    for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
      __pyx_v_i = __pyx_t_6;

      /* "pyarrow/table.pxi":675
 *                              'length of arrays ({})'.format(len(names), K))
 *         for i in range(K):
 *             val = arrays[i]             # <<<<<<<<<<<<<<
 *             if isinstance(val, (Array, ChunkedArray)):
 *                 type_ = (<DataType> val.type).sp_type
 */
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_arrays, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 675, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "pyarrow/table.pxi":676
 *         for i in range(K):
 *             val = arrays[i]
 *             if isinstance(val, (Array, ChunkedArray)):             # <<<<<<<<<<<<<<
 *                 type_ = (<DataType> val.type).sp_type
 *             else:
 */
      __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_val, __pyx_ptype_7pyarrow_3lib_Array); 
      __pyx_t_14 = (__pyx_t_4 != 0);
      if (!__pyx_t_14) {
      } else {
        __pyx_t_2 = __pyx_t_14;
        goto __pyx_L12_bool_binop_done;
      }
      __pyx_t_14 = __Pyx_TypeCheck(__pyx_v_val, __pyx_ptype_7pyarrow_3lib_ChunkedArray); 
      __pyx_t_4 = (__pyx_t_14 != 0);
      __pyx_t_2 = __pyx_t_4;
      __pyx_L12_bool_binop_done:;
      __pyx_t_4 = (__pyx_t_2 != 0);
      if (likely(__pyx_t_4)) {

        /* "pyarrow/table.pxi":677
 *             val = arrays[i]
 *             if isinstance(val, (Array, ChunkedArray)):
 *                 type_ = (<DataType> val.type).sp_type             # <<<<<<<<<<<<<<
 *             else:
 *                 raise TypeError(type(val))
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_val, __pyx_n_s_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 677, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_15 = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_7)->sp_type;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_type_ = __pyx_t_15;

        /* "pyarrow/table.pxi":676
 *         for i in range(K):
 *             val = arrays[i]
 *             if isinstance(val, (Array, ChunkedArray)):             # <<<<<<<<<<<<<<
 *                 type_ = (<DataType> val.type).sp_type
 *             else:
 */
        goto __pyx_L11;
      }

      /* "pyarrow/table.pxi":679
 *                 type_ = (<DataType> val.type).sp_type
 *             else:
 *                 raise TypeError(type(val))             # <<<<<<<<<<<<<<
 * 
 *             if names[i] is None:
 */
      /*else*/ {
        __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, ((PyObject *)Py_TYPE(__pyx_v_val))); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 679, __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(10, 679, __pyx_L1_error)
      }
      __pyx_L11:;

      /* "pyarrow/table.pxi":681
 *                 raise TypeError(type(val))
 * 
 *             if names[i] is None:             # <<<<<<<<<<<<<<
 *                 c_name = tobytes(u'None')
 *             else:
 */
      __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 681, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_4 = (__pyx_t_7 == Py_None);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_2 = (__pyx_t_4 != 0);
      if (__pyx_t_2) {

        /* "pyarrow/table.pxi":682
 * 
 *             if names[i] is None:
 *                 c_name = tobytes(u'None')             # <<<<<<<<<<<<<<
 *             else:
 *                 c_name = tobytes(names[i])
 */
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 682, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_7 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_13, __pyx_n_u_None) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_u_None);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 682, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_10 = __pyx_convert_string_from_py_std__in_string(__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 682, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_c_name = __pyx_t_10;

        /* "pyarrow/table.pxi":681
 *                 raise TypeError(type(val))
 * 
 *             if names[i] is None:             # <<<<<<<<<<<<<<
 *                 c_name = tobytes(u'None')
 *             else:
 */
        goto __pyx_L14;
      }

      /* "pyarrow/table.pxi":684
 *                 c_name = tobytes(u'None')
 *             else:
 *                 c_name = tobytes(names[i])             # <<<<<<<<<<<<<<
 *             fields[i].reset(new CField(c_name, type_, True))
 * 
 */
      /*else*/ {
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 684, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_names, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(10, 684, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __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_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_9, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_13);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 684, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_10 = __pyx_convert_string_from_py_std__in_string(__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 684, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_c_name = __pyx_t_10;
      }
      __pyx_L14:;

      /* "pyarrow/table.pxi":685
 *             else:
 *                 c_name = tobytes(names[i])
 *             fields[i].reset(new CField(c_name, type_, True))             # <<<<<<<<<<<<<<
 * 
 *     schema.reset(new CSchema(fields, unbox_metadata(metadata)))
 */
      (__pyx_v_fields[__pyx_v_i]).reset(new  arrow::Field(__pyx_v_c_name, __pyx_v_type_, 1));
    }
  }
  __pyx_L4:;

  /* "pyarrow/table.pxi":687
 *             fields[i].reset(new CField(c_name, type_, True))
 * 
 *     schema.reset(new CSchema(fields, unbox_metadata(metadata)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_schema->reset(new  arrow::Schema(__pyx_v_fields, __pyx_f_7pyarrow_3lib_unbox_metadata(__pyx_v_metadata)));

  /* "pyarrow/table.pxi":646
 * 
 * 
 * cdef _schema_from_arrays(arrays, names, dict metadata,             # <<<<<<<<<<<<<<
 *                          shared_ptr[CSchema]* schema):
 *     cdef:
 */

  /* 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_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow.lib._schema_from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_col);
  __Pyx_XDECREF(__pyx_v_val);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":700
 *     """
 * 
 *     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":701
 * 
 *     def __cinit__(self):
 *         self.batch = NULL             # <<<<<<<<<<<<<<
 *         self._schema = None
 * 
 */
  __pyx_v_self->batch = NULL;

  /* "pyarrow/table.pxi":702
 *     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":700
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.batch = NULL
 *         self._schema = None
 */

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

/* "pyarrow/table.pxi":704
 *         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":705
 * 
 *     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__106, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 705, __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, 705, __pyx_L1_error)

  /* "pyarrow/table.pxi":704
 *         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":708
 *                         "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":709
 * 
 *     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":710
 *     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":708
 *                         "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":712
 *         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":713
 * 
 *     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(10, 713, __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(10, 713, __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(10, 713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 713, __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(10, 713, __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":712
 *         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":715
 *         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":716
 * 
 *     def __len__(self):
 *         return self.batch.num_rows()             # <<<<<<<<<<<<<<
 * 
 *     def replace_schema_metadata(self, dict metadata=None):
 */
  __pyx_r = __pyx_v_self->batch->num_rows();
  goto __pyx_L0;

  /* "pyarrow/table.pxi":715
 *         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":718
 *         return self.batch.num_rows()
 * 
 *     def replace_schema_metadata(self, dict metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         EXPERIMENTAL: Create shallow copy of record batch by replacing schema
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_9replace_schema_metadata(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_8replace_schema_metadata[] = "RecordBatch.replace_schema_metadata(self, dict 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_9replace_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(10, 718, __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 = ((PyObject*)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(10, 718, __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:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metadata), (&PyDict_Type), 1, "metadata", 1))) __PYX_ERR(10, 718, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_8replace_schema_metadata(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__pyx_v_self), __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_8replace_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_new_batch;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("replace_schema_metadata", 0);

  /* "pyarrow/table.pxi":733
 *         """
 *         cdef shared_ptr[CKeyValueMetadata] c_meta
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             convert_metadata(metadata, &c_meta)
 * 
 */
  __pyx_t_1 = (__pyx_v_metadata != ((PyObject*)Py_None));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":734
 *         cdef shared_ptr[CKeyValueMetadata] c_meta
 *         if metadata is not None:
 *             convert_metadata(metadata, &c_meta)             # <<<<<<<<<<<<<<
 * 
 *         cdef shared_ptr[CRecordBatch] new_batch
 */
    __pyx_t_3 = __pyx_f_7pyarrow_3lib_convert_metadata(__pyx_v_metadata, (&__pyx_v_c_meta)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(10, 734, __pyx_L1_error)

    /* "pyarrow/table.pxi":733
 *         """
 *         cdef shared_ptr[CKeyValueMetadata] c_meta
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             convert_metadata(metadata, &c_meta)
 * 
 */
  }

  /* "pyarrow/table.pxi":737
 * 
 *         cdef shared_ptr[CRecordBatch] new_batch
 *         with nogil:             # <<<<<<<<<<<<<<
 *             new_batch = self.batch.ReplaceSchemaMetadata(c_meta)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":738
 *         cdef shared_ptr[CRecordBatch] new_batch
 *         with nogil:
 *             new_batch = self.batch.ReplaceSchemaMetadata(c_meta)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_batch(new_batch)
 */
        __pyx_v_new_batch = __pyx_v_self->batch->ReplaceSchemaMetadata(__pyx_v_c_meta);
      }

      /* "pyarrow/table.pxi":737
 * 
 *         cdef shared_ptr[CRecordBatch] new_batch
 *         with nogil:             # <<<<<<<<<<<<<<
 *             new_batch = self.batch.ReplaceSchemaMetadata(c_meta)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/table.pxi":740
 *             new_batch = self.batch.ReplaceSchemaMetadata(c_meta)
 * 
 *         return pyarrow_wrap_batch(new_batch)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_batch(__pyx_v_new_batch); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":718
 *         return self.batch.num_rows()
 * 
 *     def replace_schema_metadata(self, dict metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         EXPERIMENTAL: Create shallow copy of record batch by replacing schema
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __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":743
 * 
 *     @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":751
 *         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(10, 751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":743
 * 
 *     @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":754
 * 
 *     @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":765
 *         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(10, 765, __pyx_L1_error)
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":754
 * 
 *     @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":768
 * 
 *     @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":776
 *         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":777
 *         """
 *         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(10, 777, __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(10, 777, __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":776
 *         pyarrow.Schema
 *         """
 *         if self._schema is None:             # <<<<<<<<<<<<<<
 *             self._schema = pyarrow_wrap_schema(self.batch.schema())
 * 
 */
  }

  /* "pyarrow/table.pxi":779
 *             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":768
 * 
 *     @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":782
 * 
 *     @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_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":790
 *         list of pa.Column
 *         """
 *         return [self.column(i) for i in range(self.num_columns)]             # <<<<<<<<<<<<<<
 * 
 *     def column(self, i):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 790, __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(10, 790, __pyx_L1_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(10, 790, __pyx_L1_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(10, 790, __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(10, 790, __pyx_L1_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(10, 790, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 790, __pyx_L1_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(10, 790, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 790, __pyx_L1_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(10, 790, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__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(10, 790, __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_3 = (__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_3)) __PYX_ERR(10, 790, __pyx_L1_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(10, 790, __pyx_L1_error)
    __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/table.pxi":782
 * 
 *     @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_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":792
 *         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_11column(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_10column[] = "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_11column(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_10column(((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_10column(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__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;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("column", 0);

  /* "pyarrow/table.pxi":800
 *         column : pyarrow.Array
 *         """
 *         if not -self.num_columns <= i < self.num_columns:             # <<<<<<<<<<<<<<
 *             raise IndexError(
 *                 'Record batch column index {:d} is out of range'.format(i)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_v_i, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 800, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 800, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_RichCompare(__pyx_v_i, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 800, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(10, 800, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/table.pxi":802
 *         if not -self.num_columns <= i < self.num_columns:
 *             raise IndexError(
 *                 'Record batch column index {:d} is out of range'.format(i)             # <<<<<<<<<<<<<<
 *             )
 *         return pyarrow_wrap_array(self.batch.column(i))
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Record_batch_column_index_d_is_o, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 802, __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_i) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_i);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/table.pxi":801
 *         """
 *         if not -self.num_columns <= i < self.num_columns:
 *             raise IndexError(             # <<<<<<<<<<<<<<
 *                 'Record batch column index {:d} is out of range'.format(i)
 *             )
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 801, __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(10, 801, __pyx_L1_error)

    /* "pyarrow/table.pxi":800
 *         column : pyarrow.Array
 *         """
 *         if not -self.num_columns <= i < self.num_columns:             # <<<<<<<<<<<<<<
 *             raise IndexError(
 *                 'Record batch column index {:d} is out of range'.format(i)
 */
  }

  /* "pyarrow/table.pxi":804
 *                 'Record batch column index {:d} is out of range'.format(i)
 *             )
 *         return pyarrow_wrap_array(self.batch.column(i))             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_i); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 804, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_array(__pyx_v_self->batch->column(__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":792
 *         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_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":806
 *         return pyarrow_wrap_array(self.batch.column(i))
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_13__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_13__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_12__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_12__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;
  Py_ssize_t __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/table.pxi":807
 * 
 *     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":808
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):
 *             return _normalize_slice(self, key)             # <<<<<<<<<<<<<<
 *         else:
 *             return self.column(_normalize_index(key, self.num_columns))
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_normalize_slice); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 808, __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(10, 808, __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(10, 808, __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(10, 808, __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(10, 808, __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":807
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 *         else:
 */
  }

  /* "pyarrow/table.pxi":810
 *             return _normalize_slice(self, key)
 *         else:
 *             return self.column(_normalize_index(key, self.num_columns))             # <<<<<<<<<<<<<<
 * 
 *     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(10, 810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(10, 810, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_7); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(10, 810, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_10 = __pyx_f_7pyarrow_3lib__normalize_index(__pyx_t_8, __pyx_t_9); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1L))) __PYX_ERR(10, 810, __pyx_L1_error)
    __pyx_t_7 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __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_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 810, __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":806
 *         return pyarrow_wrap_array(self.batch.column(i))
 * 
 *     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":812
 *             return self.column(_normalize_index(key, self.num_columns))
 * 
 *     def serialize(self, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch to Buffer as encapsulated IPC message
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_15serialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_14serialize[] = "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_15serialize(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(10, 812, __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(10, 812, __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_14serialize(((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_14serialize(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":827
 *         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(10, 827, __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":829
 *             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":830
 * 
 *         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(10, 830, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":829
 *             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":832
 *             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(10, 832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":812
 *             return self.column(_normalize_index(key, self.num_columns))
 * 
 *     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":834
 *         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_17slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_16slice[] = "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 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 : RecordBatch\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_17slice(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(10, 834, __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(10, 834, __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_16slice(((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_16slice(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":852
 *         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(10, 852, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(10, 852, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/table.pxi":853
 * 
 *         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__83, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 853, __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, 853, __pyx_L1_error)

    /* "pyarrow/table.pxi":852
 *         cdef shared_ptr[CRecordBatch] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/table.pxi":855
 *             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":856
 * 
 *         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(10, 856, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->batch->Slice(__pyx_t_4);

    /* "pyarrow/table.pxi":855
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = self.batch.Slice(offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/table.pxi":858
 *             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(10, 858, __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(10, 858, __pyx_L1_error)
    __pyx_v_result = __pyx_v_self->batch->Slice(__pyx_t_4, __pyx_t_5);
  }
  __pyx_L4:;

  /* "pyarrow/table.pxi":860
 *             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(10, 860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":834
 *         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":862
 *         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_19equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_18equals[] = "RecordBatch.equals(self, RecordBatch other)";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_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_RecordBatch, 1, "other", 0))) __PYX_ERR(10, 862, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_18equals(((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_18equals(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":864
 *     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":865
 *         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":868
 *             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":869
 * 
 *         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":868
 *             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":871
 *             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(10, 871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":862
 *         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":873
 *         return result
 * 
 *     def to_pydict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Converted the arrow::RecordBatch to an OrderedDict
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_21to_pydict(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_20to_pydict[] = "RecordBatch.to_pydict(self)\n\n        Converted the arrow::RecordBatch to an OrderedDict\n\n        Returns\n        -------\n        OrderedDict\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_21to_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_20to_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_20to_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":881
 *         OrderedDict
 *         """
 *         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(10, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_entries = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":882
 *         """
 *         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":883
 *         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(10, 883, __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(10, 883, __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(10, 883, __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":884
 *         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 OrderedDict(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(10, 884, __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(10, 884, __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(10, 884, __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":885
 *             name = bytes(self.batch.column_name(i)).decode('utf8')
 *             column = self[i].to_pylist()
 *             entries.append((name, column))             # <<<<<<<<<<<<<<
 *         return OrderedDict(entries)
 * 
 */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 885, __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(10, 885, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyarrow/table.pxi":886
 *             column = self[i].to_pylist()
 *             entries.append((name, column))
 *         return OrderedDict(entries)             # <<<<<<<<<<<<<<
 * 
 *     def to_pandas(self, MemoryPool memory_pool=None, categories=None,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 886, __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(10, 886, __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":873
 *         return result
 * 
 *     def to_pydict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Converted the arrow::RecordBatch to an 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":888
 *         return OrderedDict(entries)
 * 
 *     def to_pandas(self, MemoryPool memory_pool=None, categories=None,             # <<<<<<<<<<<<<<
 *                   bint strings_to_categorical=False, bint zero_copy_only=False,
 *                   bint integer_object_nulls=False, bint date_as_object=False,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_23to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_22to_pandas[] = "RecordBatch.to_pandas(self, MemoryPool memory_pool=None, categories=None, bool strings_to_categorical=False, bool zero_copy_only=False, bool integer_object_nulls=False, bool date_as_object=False, bool use_threads=True)\n\n        Convert the arrow::RecordBatch to a pandas DataFrame\n\n        Parameters\n        ----------\n        memory_pool: MemoryPool, optional\n            Specific memory pool to use to allocate casted columns\n        categories: list, default empty\n            List of columns that should be returned as pandas.Categorical\n        strings_to_categorical : boolean, default False\n            Encode string (UTF8) and binary types to pandas.Categorical\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\n        Returns\n        -------\n        pandas.DataFrame\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_23to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__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;
  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,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)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  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--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_pandas") < 0)) __PYX_ERR(10, 888, __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);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)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(10, 889, __pyx_L3_error)
    } else {

      /* "pyarrow/table.pxi":889
 * 
 *     def to_pandas(self, MemoryPool memory_pool=None, categories=None,
 *                   bint strings_to_categorical=False, bint zero_copy_only=False,             # <<<<<<<<<<<<<<
 *                   bint integer_object_nulls=False, bint date_as_object=False,
 *                   bint use_threads=True):
 */
      __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(10, 889, __pyx_L3_error)
    } else {
      __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(10, 890, __pyx_L3_error)
    } else {

      /* "pyarrow/table.pxi":890
 *     def to_pandas(self, MemoryPool memory_pool=None, categories=None,
 *                   bint strings_to_categorical=False, bint zero_copy_only=False,
 *                   bint integer_object_nulls=False, bint date_as_object=False,             # <<<<<<<<<<<<<<
 *                   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(10, 890, __pyx_L3_error)
    } else {
      __pyx_v_date_as_object = ((int)0);
    }
    if (values[6]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 891, __pyx_L3_error)
    } else {

      /* "pyarrow/table.pxi":891
 *                   bint strings_to_categorical=False, bint zero_copy_only=False,
 *                   bint integer_object_nulls=False, bint date_as_object=False,
 *                   bint use_threads=True):             # <<<<<<<<<<<<<<
 *         """
 *         Convert the arrow::RecordBatch to a pandas DataFrame
 */
      __pyx_v_use_threads = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_pandas", 0, 0, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 888, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.to_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(10, 888, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_22to_pandas(((struct __pyx_obj_7pyarrow_3lib_RecordBatch *)__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);

  /* "pyarrow/table.pxi":888
 *         return OrderedDict(entries)
 * 
 *     def to_pandas(self, MemoryPool memory_pool=None, categories=None,             # <<<<<<<<<<<<<<
 *                   bint strings_to_categorical=False, bint zero_copy_only=False,
 *                   bint integer_object_nulls=False, bint date_as_object=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_11RecordBatch_22to_pandas(struct __pyx_obj_7pyarrow_3lib_RecordBatch *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__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) {
  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":917
 *         pandas.DataFrame
 *         """
 *         return Table.from_batches([self]).to_pandas(             # <<<<<<<<<<<<<<
 *             memory_pool=memory_pool, categories=categories,
 *             strings_to_categorical=strings_to_categorical,
 */
  __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(10, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 917, __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(10, 917, __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(10, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":918
 *         """
 *         return Table.from_batches([self]).to_pandas(
 *             memory_pool=memory_pool, categories=categories,             # <<<<<<<<<<<<<<
 *             strings_to_categorical=strings_to_categorical,
 *             zero_copy_only=zero_copy_only,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_memory_pool, ((PyObject *)__pyx_v_memory_pool)) < 0) __PYX_ERR(10, 918, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_categories, __pyx_v_categories) < 0) __PYX_ERR(10, 918, __pyx_L1_error)

  /* "pyarrow/table.pxi":919
 *         return Table.from_batches([self]).to_pandas(
 *             memory_pool=memory_pool, categories=categories,
 *             strings_to_categorical=strings_to_categorical,             # <<<<<<<<<<<<<<
 *             zero_copy_only=zero_copy_only,
 *             integer_object_nulls=integer_object_nulls,
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_strings_to_categorical); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_strings_to_categorical, __pyx_t_3) < 0) __PYX_ERR(10, 918, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":920
 *             memory_pool=memory_pool, categories=categories,
 *             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_3 = __Pyx_PyBool_FromLong(__pyx_v_zero_copy_only); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_zero_copy_only, __pyx_t_3) < 0) __PYX_ERR(10, 918, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":921
 *             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_3 = __Pyx_PyBool_FromLong(__pyx_v_integer_object_nulls); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 921, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_integer_object_nulls, __pyx_t_3) < 0) __PYX_ERR(10, 918, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":922
 *             zero_copy_only=zero_copy_only,
 *             integer_object_nulls=integer_object_nulls,
 *             date_as_object=date_as_object, use_threads=use_threads             # <<<<<<<<<<<<<<
 *         )
 * 
 */
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_date_as_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_date_as_object, __pyx_t_3) < 0) __PYX_ERR(10, 918, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_use_threads); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_use_threads, __pyx_t_3) < 0) __PYX_ERR(10, 918, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":917
 *         pandas.DataFrame
 *         """
 *         return Table.from_batches([self]).to_pandas(             # <<<<<<<<<<<<<<
 *             memory_pool=memory_pool, categories=categories,
 *             strings_to_categorical=strings_to_categorical,
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 917, __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":888
 *         return OrderedDict(entries)
 * 
 *     def to_pandas(self, MemoryPool memory_pool=None, categories=None,             # <<<<<<<<<<<<<<
 *                   bint strings_to_categorical=False, bint zero_copy_only=False,
 *                   bint integer_object_nulls=False, bint date_as_object=False,
 */

  /* 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":926
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, bint preserve_index=True,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_25from_pandas(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_24from_pandas[] = "RecordBatch.from_pandas(type cls, df, Schema schema=None, bool preserve_index=True, 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        preserve_index : bool, optional\n            Whether to store the index as an additional column in the resulting\n            ``RecordBatch``.\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_25from_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;
  int __pyx_v_preserve_index;
  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);

    /* "pyarrow/table.pxi":927
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, bint preserve_index=True,
 *                     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(10, 926, __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]);
    if (values[2]) {
      __pyx_v_preserve_index = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_preserve_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 926, __pyx_L3_error)
    } else {

      /* "pyarrow/table.pxi":926
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, bint preserve_index=True,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None):
 *         """
 */
      __pyx_v_preserve_index = ((int)1);
    }
    __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(10, 926, __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(10, 926, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_24from_pandas(((PyTypeObject*)__pyx_v_cls), __pyx_v_df, __pyx_v_schema, __pyx_v_preserve_index, __pyx_v_nthreads, __pyx_v_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_11RecordBatch_24from_pandas(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, int __pyx_v_preserve_index, PyObject *__pyx_v_nthreads, PyObject *__pyx_v_columns) {
  PyObject *__pyx_v_names = NULL;
  PyObject *__pyx_v_arrays = NULL;
  PyObject *__pyx_v_metadata = 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 *);
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("from_pandas", 0);

  /* "pyarrow/table.pxi":950
 *         pyarrow.RecordBatch
 *         """
 *         names, arrays, metadata = pdcompat.dataframe_to_arrays(             # <<<<<<<<<<<<<<
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns
 *         )
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pdcompat); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dataframe_to_arrays); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":951
 *         """
 *         names, arrays, metadata = pdcompat.dataframe_to_arrays(
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns             # <<<<<<<<<<<<<<
 *         )
 *         return cls.from_arrays(arrays, names, metadata)
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_preserve_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/table.pxi":950
 *         pyarrow.RecordBatch
 *         """
 *         names, arrays, metadata = pdcompat.dataframe_to_arrays(             # <<<<<<<<<<<<<<
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns
 *         )
 */
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_df);
  __Pyx_GIVEREF(__pyx_v_df);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_df);
  __Pyx_INCREF(((PyObject *)__pyx_v_schema));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_schema));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_schema));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":951
 *         """
 *         names, arrays, metadata = pdcompat.dataframe_to_arrays(
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns             # <<<<<<<<<<<<<<
 *         )
 *         return cls.from_arrays(arrays, names, metadata)
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_nthreads, __pyx_v_nthreads) < 0) __PYX_ERR(10, 951, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_columns, __pyx_v_columns) < 0) __PYX_ERR(10, 951, __pyx_L1_error)

  /* "pyarrow/table.pxi":950
 *         pyarrow.RecordBatch
 *         """
 *         names, arrays, metadata = pdcompat.dataframe_to_arrays(             # <<<<<<<<<<<<<<
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns
 *         )
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  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 != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(10, 950, __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_3 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 950, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #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(10, 950, __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_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_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(10, 950, __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(10, 950, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_names = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_arrays = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_metadata = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":953
 *             df, schema, preserve_index, nthreads=nthreads, columns=columns
 *         )
 *         return cls.from_arrays(arrays, names, metadata)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_7 = 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_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_arrays, __pyx_v_names, __pyx_v_metadata};
    __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 953, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_arrays, __pyx_v_names, __pyx_v_metadata};
    __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 953, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else
  #endif
  {
    __pyx_t_1 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 953, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_arrays);
    __Pyx_GIVEREF(__pyx_v_arrays);
    PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_v_arrays);
    __Pyx_INCREF(__pyx_v_names);
    __Pyx_GIVEREF(__pyx_v_names);
    PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_v_names);
    __Pyx_INCREF(__pyx_v_metadata);
    __Pyx_GIVEREF(__pyx_v_metadata);
    PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_7, __pyx_v_metadata);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 953, __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_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":926
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, bint preserve_index=True,             # <<<<<<<<<<<<<<
 *                     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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.RecordBatch.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_arrays);
  __Pyx_XDECREF(__pyx_v_metadata);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":956
 * 
 *     @staticmethod
 *     def from_arrays(list arrays, names, dict metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from multiple pyarrow.Arrays
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_27from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_11RecordBatch_26from_arrays[] = "RecordBatch.from_arrays(list arrays, names, dict metadata=None)\n\n        Construct a RecordBatch from multiple pyarrow.Arrays\n\n        Parameters\n        ----------\n        arrays: list of pyarrow.Array\n            column-wise data vectors\n        names: pyarrow.Schema or list of str\n            schema or list of labels for the columns\n\n        Returns\n        -------\n        pyarrow.RecordBatch\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_11RecordBatch_27from_arrays = {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_27from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_26from_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_11RecordBatch_27from_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_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_metadata,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_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_names)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("from_arrays", 0, 2, 3, 1); __PYX_ERR(10, 956, __pyx_L3_error)
        }
        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_arrays") < 0)) __PYX_ERR(10, 956, __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_arrays = ((PyObject*)values[0]);
    __pyx_v_names = values[1];
    __pyx_v_metadata = ((PyObject*)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(10, 956, __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(10, 956, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metadata), (&PyDict_Type), 1, "metadata", 1))) __PYX_ERR(10, 956, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_11RecordBatch_26from_arrays(__pyx_v_arrays, __pyx_v_names, __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_26from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, 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;
  CYTHON_UNUSED int64_t __pyx_v_number_of_arrays;
  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;
  std::shared_ptr< arrow::Schema>  __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  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);

  /* "pyarrow/table.pxi":978
 *             int64_t num_rows
 *             int64_t i
 *             int64_t number_of_arrays = len(arrays)             # <<<<<<<<<<<<<<
 * 
 *         if len(arrays) > 0:
 */
  if (unlikely(__pyx_v_arrays == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(10, 978, __pyx_L1_error)
  }
  __pyx_t_1 = PyList_GET_SIZE(__pyx_v_arrays); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(10, 978, __pyx_L1_error)
  __pyx_v_number_of_arrays = __pyx_t_1;

  /* "pyarrow/table.pxi":980
 *             int64_t number_of_arrays = len(arrays)
 * 
 *         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(10, 980, __pyx_L1_error)
  }
  __pyx_t_1 = PyList_GET_SIZE(__pyx_v_arrays); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(10, 980, __pyx_L1_error)
  __pyx_t_2 = ((__pyx_t_1 > 0) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":981
 * 
 *         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(10, 981, __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(10, 981, __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(10, 981, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_num_rows = __pyx_t_1;

    /* "pyarrow/table.pxi":980
 *             int64_t number_of_arrays = len(arrays)
 * 
 *         if len(arrays) > 0:             # <<<<<<<<<<<<<<
 *             num_rows = len(arrays[0])
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/table.pxi":983
 *             num_rows = len(arrays[0])
 *         else:
 *             num_rows = 0             # <<<<<<<<<<<<<<
 *         if isinstance(names, Schema):
 *             c_schema = (<Schema> names).sp_schema
 */
  /*else*/ {
    __pyx_v_num_rows = 0;
  }
  __pyx_L3:;

  /* "pyarrow/table.pxi":984
 *         else:
 *             num_rows = 0
 *         if isinstance(names, Schema):             # <<<<<<<<<<<<<<
 *             c_schema = (<Schema> names).sp_schema
 *         else:
 */
  __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":985
 *             num_rows = 0
 *         if isinstance(names, Schema):
 *             c_schema = (<Schema> names).sp_schema             # <<<<<<<<<<<<<<
 *         else:
 *             _schema_from_arrays(arrays, names, metadata, &c_schema)
 */
    __pyx_t_5 = ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_v_names)->sp_schema;
    __pyx_v_c_schema = __pyx_t_5;

    /* "pyarrow/table.pxi":984
 *         else:
 *             num_rows = 0
 *         if isinstance(names, Schema):             # <<<<<<<<<<<<<<
 *             c_schema = (<Schema> names).sp_schema
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/table.pxi":987
 *             c_schema = (<Schema> names).sp_schema
 *         else:
 *             _schema_from_arrays(arrays, names, metadata, &c_schema)             # <<<<<<<<<<<<<<
 * 
 *         c_arrays.reserve(len(arrays))
 */
  /*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(10, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L4:;

  /* "pyarrow/table.pxi":989
 *             _schema_from_arrays(arrays, names, metadata, &c_schema)
 * 
 *         c_arrays.reserve(len(arrays))             # <<<<<<<<<<<<<<
 *         for arr in 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(10, 989, __pyx_L1_error)
  }
  __pyx_t_1 = PyList_GET_SIZE(__pyx_v_arrays); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(10, 989, __pyx_L1_error)
  __pyx_v_c_arrays.reserve(__pyx_t_1);

  /* "pyarrow/table.pxi":990
 * 
 *         c_arrays.reserve(len(arrays))
 *         for arr in arrays:             # <<<<<<<<<<<<<<
 *             if len(arr) != num_rows:
 *                 raise ValueError('Arrays were not all the same length: '
 */
  if (unlikely(__pyx_v_arrays == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(10, 990, __pyx_L1_error)
  }
  __pyx_t_3 = __pyx_v_arrays; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_1 >= 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_1); __Pyx_INCREF(__pyx_t_6); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(10, 990, __pyx_L1_error)
    #else
    __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 990, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_7pyarrow_3lib_Array))))) __PYX_ERR(10, 990, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_arr, ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "pyarrow/table.pxi":991
 *         c_arrays.reserve(len(arrays))
 *         for arr in 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(10, 991, __pyx_L1_error)
    __pyx_t_4 = ((__pyx_t_7 != __pyx_v_num_rows) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/table.pxi":993
 *             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_s_Arrays_were_not_all_the_same_len, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 993, __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(10, 993, __pyx_L1_error)
      __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 993, __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(10, 993, __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_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 993, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __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_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 993, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_GOTREF(__pyx_t_6);
        __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(10, 993, __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_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 993, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "pyarrow/table.pxi":992
 *         for arr in 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_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 992, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_Raise(__pyx_t_8, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __PYX_ERR(10, 992, __pyx_L1_error)

      /* "pyarrow/table.pxi":991
 *         c_arrays.reserve(len(arrays))
 *         for arr in 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":994
 *                 raise ValueError('Arrays were not all the same length: '
 *                                  '{0} vs {1}'.format(len(arr), num_rows))
 *             c_arrays.push_back(arr.sp_array)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_batch(
 */
    try {
      __pyx_v_c_arrays.push_back(__pyx_v_arr->sp_array);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(10, 994, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":990
 * 
 *         c_arrays.reserve(len(arrays))
 *         for arr in arrays:             # <<<<<<<<<<<<<<
 *             if len(arr) != num_rows:
 *                 raise ValueError('Arrays were not all the same length: '
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/table.pxi":996
 *             c_arrays.push_back(arr.sp_array)
 * 
 *         return pyarrow_wrap_batch(             # <<<<<<<<<<<<<<
 *             CRecordBatch.Make(c_schema, num_rows, c_arrays))
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/table.pxi":997
 * 
 *         return pyarrow_wrap_batch(
 *             CRecordBatch.Make(c_schema, num_rows, c_arrays))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __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_3)) __PYX_ERR(10, 996, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":956
 * 
 *     @staticmethod
 *     def from_arrays(list arrays, names, dict metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from multiple pyarrow.Arrays
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1000
 * 
 * 
 * def _reconstruct_record_batch(columns, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct RecordBatch from pickled components.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_97_reconstruct_record_batch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_96_reconstruct_record_batch[] = "_reconstruct_record_batch(columns, schema)\n\n    Internal: reconstruct RecordBatch from pickled components.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_97_reconstruct_record_batch = {"_reconstruct_record_batch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_97_reconstruct_record_batch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_96_reconstruct_record_batch};
static PyObject *__pyx_pw_7pyarrow_3lib_97_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(10, 1000, __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(10, 1000, __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(10, 1000, __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_96_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_96_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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_reconstruct_record_batch", 0);

  /* "pyarrow/table.pxi":1004
 *     Internal: reconstruct RecordBatch from pickled components.
 *     """
 *     return RecordBatch.from_arrays(columns, schema)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1004, __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_columns, __pyx_v_schema};
    __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(10, 1004, __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_columns, __pyx_v_schema};
    __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(10, 1004, __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(10, 1004, __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_columns);
    __Pyx_GIVEREF(__pyx_v_columns);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_columns);
    __Pyx_INCREF(__pyx_v_schema);
    __Pyx_GIVEREF(__pyx_v_schema);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_schema);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1004, __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/table.pxi":1000
 * 
 * 
 * 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_5);
  __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":1007
 * 
 * 
 * def table_to_blocks(PandasOptions options, Table table,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool, categories):
 *     cdef:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_99table_to_blocks(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_98table_to_blocks[] = "table_to_blocks(PandasOptions options, Table table, MemoryPool memory_pool, categories)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_99table_to_blocks = {"table_to_blocks", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_99table_to_blocks, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_98table_to_blocks};
static PyObject *__pyx_pw_7pyarrow_3lib_99table_to_blocks(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct arrow::py::PandasOptions __pyx_v_options;
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table = 0;
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool = 0;
  PyObject *__pyx_v_categories = 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_memory_pool,&__pyx_n_s_categories,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(10, 1007, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_memory_pool)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("table_to_blocks", 1, 4, 4, 2); __PYX_ERR(10, 1007, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_categories)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("table_to_blocks", 1, 4, 4, 3); __PYX_ERR(10, 1007, __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(10, 1007, __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 = __pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 1007, __pyx_L3_error)
    __pyx_v_table = ((struct __pyx_obj_7pyarrow_3lib_Table *)values[1]);
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)values[2]);
    __pyx_v_categories = 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(10, 1007, __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(10, 1007, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(10, 1008, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_98table_to_blocks(__pyx_self, __pyx_v_options, __pyx_v_table, __pyx_v_memory_pool, __pyx_v_categories);

  /* 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_98table_to_blocks(CYTHON_UNUSED PyObject *__pyx_self, struct arrow::py::PandasOptions __pyx_v_options, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__pyx_v_memory_pool, PyObject *__pyx_v_categories) {
  PyObject *__pyx_v_result_obj;
  std::shared_ptr< arrow::Table>  __pyx_v_c_table;
   arrow::MemoryPool *__pyx_v_pool;
  std::unordered_set<std::string>  __pyx_v_categorical_columns;
  PyObject *__pyx_8genexpr1__pyx_v_cat = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::shared_ptr< arrow::Table>  __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::unordered_set<std::string>  __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("table_to_blocks", 0);

  /* "pyarrow/table.pxi":1011
 *     cdef:
 *         PyObject* result_obj
 *         shared_ptr[CTable] c_table = table.sp_table             # <<<<<<<<<<<<<<
 *         CMemoryPool* pool
 *         unordered_set[c_string] categorical_columns
 */
  __pyx_t_1 = __pyx_v_table->sp_table;
  __pyx_v_c_table = __pyx_t_1;

  /* "pyarrow/table.pxi":1015
 *         unordered_set[c_string] categorical_columns
 * 
 *     if categories is not None:             # <<<<<<<<<<<<<<
 *         categorical_columns = {tobytes(cat) for cat in categories}
 * 
 */
  __pyx_t_2 = (__pyx_v_categories != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":1016
 * 
 *     if categories is not None:
 *         categorical_columns = {tobytes(cat) for cat in categories}             # <<<<<<<<<<<<<<
 * 
 *     pool = maybe_unbox_memory_pool(memory_pool)
 */
    { /* enter inner scope */
      __pyx_t_4 = PySet_New(NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1016, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (likely(PyList_CheckExact(__pyx_v_categories)) || PyTuple_CheckExact(__pyx_v_categories)) {
        __pyx_t_5 = __pyx_v_categories; __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_categories); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 1016, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 1016, __pyx_L6_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(10, 1016, __pyx_L6_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 1016, __pyx_L6_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(10, 1016, __pyx_L6_error)
            #else
            __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 1016, __pyx_L6_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(10, 1016, __pyx_L6_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_8);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_cat, __pyx_t_8);
        __pyx_t_8 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(10, 1016, __pyx_L6_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_8genexpr1__pyx_v_cat) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_8genexpr1__pyx_v_cat);
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(10, 1016, __pyx_L6_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(PySet_Add(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(10, 1016, __pyx_L6_error)
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_cat); __pyx_8genexpr1__pyx_v_cat = 0;
      goto __pyx_L9_exit_scope;
      __pyx_L6_error:;
      __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_cat); __pyx_8genexpr1__pyx_v_cat = 0;
      goto __pyx_L1_error;
      __pyx_L9_exit_scope:;
    } /* exit inner scope */
    __pyx_t_11 = __pyx_convert_unordered_set_from_py_std_3a__3a_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(10, 1016, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_categorical_columns = __pyx_t_11;

    /* "pyarrow/table.pxi":1015
 *         unordered_set[c_string] categorical_columns
 * 
 *     if categories is not None:             # <<<<<<<<<<<<<<
 *         categorical_columns = {tobytes(cat) for cat in categories}
 * 
 */
  }

  /* "pyarrow/table.pxi":1018
 *         categorical_columns = {tobytes(cat) for cat in categories}
 * 
 *     pool = maybe_unbox_memory_pool(memory_pool)             # <<<<<<<<<<<<<<
 *     with nogil:
 *         check_status(
 */
  __pyx_v_pool = __pyx_f_7pyarrow_3lib_maybe_unbox_memory_pool(__pyx_v_memory_pool);

  /* "pyarrow/table.pxi":1019
 * 
 *     pool = maybe_unbox_memory_pool(memory_pool)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(
 *             libarrow.ConvertTableToPandas(
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1020
 *     pool = maybe_unbox_memory_pool(memory_pool)
 *     with nogil:
 *         check_status(             # <<<<<<<<<<<<<<
 *             libarrow.ConvertTableToPandas(
 *                 options, categorical_columns, c_table, pool, &result_obj)
 */
        __pyx_t_12 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::ConvertTableToPandas(__pyx_v_options, __pyx_v_categorical_columns, __pyx_v_c_table, __pyx_v_pool, (&__pyx_v_result_obj))); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(10, 1020, __pyx_L11_error)
      }

      /* "pyarrow/table.pxi":1019
 * 
 *     pool = maybe_unbox_memory_pool(memory_pool)
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(
 *             libarrow.ConvertTableToPandas(
 */
      /*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":1025
 *         )
 * 
 *     return PyObject_to_object(result_obj)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_result_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1007
 * 
 * 
 * def table_to_blocks(PandasOptions options, Table table,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool, categories):
 *     cdef:
 */

  /* 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_AddTraceback("pyarrow.lib.table_to_blocks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_cat);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1038
 *     """
 * 
 *     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":1039
 * 
 *     def __cinit__(self):
 *         self.table = NULL             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  __pyx_v_self->table = NULL;

  /* "pyarrow/table.pxi":1038
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.table = NULL
 * 
 */

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

/* "pyarrow/table.pxi":1041
 *         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":1042
 * 
 *     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__107, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1042, __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, 1042, __pyx_L1_error)

  /* "pyarrow/table.pxi":1041
 *         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":1045
 *                         "the `Table.from_*` functions instead.")
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'pyarrow.{}\n{}'.format(type(self).__name__, str(self.schema))
 * 
 */

/* 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
  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;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pyarrow/table.pxi":1046
 * 
 *     def __repr__(self):
 *         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_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_pyarrow, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1046, __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); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 1046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_schema); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 1046, __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 && 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_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1046, __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;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1046, __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;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 1046, __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_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1046, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 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":1045
 *                         "the `Table.from_*` functions instead.")
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'pyarrow.{}\n{}'.format(type(self).__name__, str(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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __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":1048
 *         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":1049
 * 
 *     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":1050
 *     cdef void init(self, const shared_ptr[CTable]& table):
 *         self.sp_table = table
 *         self.table = table.get()             # <<<<<<<<<<<<<<
 * 
 *     def _validate(self):
 */
  __pyx_v_self->table = __pyx_v_table.get();

  /* "pyarrow/table.pxi":1048
 *         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":1052
 *         self.table = table.get()
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Validate table consistency.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_7_validate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_6_validate[] = "Table._validate(self)\n\n        Validate table consistency.\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_7_validate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_validate (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_6_validate(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_6_validate(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_validate", 0);

  /* "pyarrow/table.pxi":1056
 *         Validate table consistency.
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.Validate())
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1057
 *         """
 *         with nogil:
 *             check_status(self.table.Validate())             # <<<<<<<<<<<<<<
 * 
 *     def __reduce__(self):
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->Validate()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 1057, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":1056
 *         Validate table consistency.
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.Validate())
 * 
 */
      /*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":1052
 *         self.table = table.get()
 * 
 *     def _validate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Validate table consistency.
 */

  /* 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":1059
 *             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_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":1062
 *         # Reduce the columns as ChunkedArrays to avoid serializing schema
 *         # data twice
 *         columns = [col.data for col in self.columns]             # <<<<<<<<<<<<<<
 *         return _reconstruct_table, (columns, self.schema)
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1062, __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(10, 1062, __pyx_L1_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(10, 1062, __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(10, 1062, __pyx_L1_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(10, 1062, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1062, __pyx_L1_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(10, 1062, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1062, __pyx_L1_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(10, 1062, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_col, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_col, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1062, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(10, 1062, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_columns = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1063
 *         # data twice
 *         columns = [col.data for col in self.columns]
 *         return _reconstruct_table, (columns, self.schema)             # <<<<<<<<<<<<<<
 * 
 *     def replace_schema_metadata(self, dict metadata=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_reconstruct_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1063, __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(10, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1063, __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(10, 1063, __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":1059
 *             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_v_col);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1065
 *         return _reconstruct_table, (columns, self.schema)
 * 
 *     def replace_schema_metadata(self, dict metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         EXPERIMENTAL: Create shallow copy of table by replacing schema
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_11replace_schema_metadata(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_10replace_schema_metadata[] = "Table.replace_schema_metadata(self, dict 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_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(10, 1065, __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 = ((PyObject*)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(10, 1065, __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:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metadata), (&PyDict_Type), 1, "metadata", 1))) __PYX_ERR(10, 1065, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_10replace_schema_metadata(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __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_5Table_10replace_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_new_table;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("replace_schema_metadata", 0);

  /* "pyarrow/table.pxi":1080
 *         """
 *         cdef shared_ptr[CKeyValueMetadata] c_meta
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             convert_metadata(metadata, &c_meta)
 * 
 */
  __pyx_t_1 = (__pyx_v_metadata != ((PyObject*)Py_None));
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":1081
 *         cdef shared_ptr[CKeyValueMetadata] c_meta
 *         if metadata is not None:
 *             convert_metadata(metadata, &c_meta)             # <<<<<<<<<<<<<<
 * 
 *         cdef shared_ptr[CTable] new_table
 */
    __pyx_t_3 = __pyx_f_7pyarrow_3lib_convert_metadata(__pyx_v_metadata, (&__pyx_v_c_meta)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(10, 1081, __pyx_L1_error)

    /* "pyarrow/table.pxi":1080
 *         """
 *         cdef shared_ptr[CKeyValueMetadata] c_meta
 *         if metadata is not None:             # <<<<<<<<<<<<<<
 *             convert_metadata(metadata, &c_meta)
 * 
 */
  }

  /* "pyarrow/table.pxi":1084
 * 
 *         cdef shared_ptr[CTable] new_table
 *         with nogil:             # <<<<<<<<<<<<<<
 *             new_table = self.table.ReplaceSchemaMetadata(c_meta)
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1085
 *         cdef shared_ptr[CTable] new_table
 *         with nogil:
 *             new_table = self.table.ReplaceSchemaMetadata(c_meta)             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(new_table)
 */
        __pyx_v_new_table = __pyx_v_self->table->ReplaceSchemaMetadata(__pyx_v_c_meta);
      }

      /* "pyarrow/table.pxi":1084
 * 
 *         cdef shared_ptr[CTable] new_table
 *         with nogil:             # <<<<<<<<<<<<<<
 *             new_table = self.table.ReplaceSchemaMetadata(c_meta)
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L6;
        }
        __pyx_L6:;
      }
  }

  /* "pyarrow/table.pxi":1087
 *             new_table = self.table.ReplaceSchemaMetadata(c_meta)
 * 
 *         return pyarrow_wrap_table(new_table)             # <<<<<<<<<<<<<<
 * 
 *     def flatten(self, MemoryPool memory_pool=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_new_table); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1065
 *         return _reconstruct_table, (columns, self.schema)
 * 
 *     def replace_schema_metadata(self, dict metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         EXPERIMENTAL: Create shallow copy of table by replacing schema
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __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":1089
 *         return pyarrow_wrap_table(new_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_13flatten(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_12flatten[] = "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_13flatten(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(10, 1089, __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(10, 1089, __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(10, 1089, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_12flatten(((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_12flatten(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":1105
 *         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":1107
 *             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":1108
 * 
 *         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(10, 1108, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":1107
 *             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":1110
 *             check_status(self.table.Flatten(pool, &flattened))
 * 
 *         return pyarrow_wrap_table(flattened)             # <<<<<<<<<<<<<<
 * 
 *     def equals(self, Table other):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_flattened); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1089
 *         return pyarrow_wrap_table(new_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":1112
 *         return pyarrow_wrap_table(flattened)
 * 
 *     def equals(self, Table other):             # <<<<<<<<<<<<<<
 *         """
 *         Check if contents of two tables are equal
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_15equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_14equals[] = "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_15equals(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(10, 1112, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_14equals(((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_14equals(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;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("equals", 0);

  /* "pyarrow/table.pxi":1125
 *         """
 *         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":1126
 *         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":1129
 *             c_bool result
 * 
 *         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":1130
 * 
 *         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":1129
 *             c_bool result
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             result = this_table.Equals(deref(other_table))
 * 
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pyarrow/table.pxi":1132
 *             result = this_table.Equals(deref(other_table))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def cast(self, Schema target_schema, bint safe=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1112
 *         return pyarrow_wrap_table(flattened)
 * 
 *     def equals(self, Table other):             # <<<<<<<<<<<<<<
 *         """
 *         Check if contents of two tables are equal
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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":1134
 *         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_17cast(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_16cast[] = "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_17cast(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(10, 1134, __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(10, 1134, __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(10, 1134, __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(10, 1134, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_16cast(((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_16cast(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_Column *__pyx_v_column = 0;
  struct __pyx_obj_7pyarrow_3lib_Column *__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":1152
 *             Column 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(10, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_newcols = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1154
 *             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(10, 1154, __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(10, 1154, __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(10, 1154, __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(10, 1154, __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(10, 1154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/table.pxi":1157
 *             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_s_Target_schema_s_field_names_are, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1157, __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(10, 1157, __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(10, 1157, __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(10, 1157, __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(10, 1157, __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(10, 1157, __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(10, 1157, __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(10, 1157, __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":1155
 * 
 *         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(10, 1155, __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(10, 1155, __pyx_L1_error)

    /* "pyarrow/table.pxi":1154
 *             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":1159
 *                              .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(10, 1159, __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(10, 1159, __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(10, 1159, __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(10, 1159, __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(10, 1159, __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(10, 1159, __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(10, 1159, __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(10, 1159, __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(10, 1159, __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(10, 1159, __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(10, 1159, __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(10, 1159, __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(10, 1159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1159, __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(10, 1159, __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(10, 1159, __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(10, 1159, __pyx_L1_error)
      __pyx_L7_unpacking_done:;
    }
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7pyarrow_3lib_Column))))) __PYX_ERR(10, 1159, __pyx_L1_error)
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_Field))))) __PYX_ERR(10, 1159, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_column, ((struct __pyx_obj_7pyarrow_3lib_Column *)__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":1160
 * 
 *         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(10, 1160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1160, __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(10, 1160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_safe); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 1160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_safe, __pyx_t_5) < 0) __PYX_ERR(10, 1160, __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(10, 1160, __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_Column))))) __PYX_ERR(10, 1160, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_casted, ((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "pyarrow/table.pxi":1161
 *         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(10, 1161, __pyx_L1_error)

    /* "pyarrow/table.pxi":1159
 *                              .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":1163
 *             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(10, 1163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 1163, __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(10, 1163, __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(10, 1163, __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(10, 1163, __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":1134
 *         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":1166
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, bint preserve_index=True,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None, bint safe=True):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_19from_pandas(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_18from_pandas[] = "Table.from_pandas(type cls, df, Schema schema=None, bool preserve_index=True, 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        preserve_index : bool, optional\n            Whether to store the index as an additional column in the resulting\n            ``Table``.\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        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_19from_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;
  int __pyx_v_preserve_index;
  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);

    /* "pyarrow/table.pxi":1167
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, bint preserve_index=True,
 *                     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(10, 1166, __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]);
    if (values[2]) {
      __pyx_v_preserve_index = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_preserve_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 1166, __pyx_L3_error)
    } else {

      /* "pyarrow/table.pxi":1166
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, bint preserve_index=True,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None, bint safe=True):
 *         """
 */
      __pyx_v_preserve_index = ((int)1);
    }
    __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(10, 1167, __pyx_L3_error)
    } else {

      /* "pyarrow/table.pxi":1167
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, bint preserve_index=True,
 *                     nthreads=None, columns=None, bint safe=True):             # <<<<<<<<<<<<<<
 *         """
 *         Convert pandas.DataFrame to an Arrow Table.
 */
      __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(10, 1166, __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(10, 1166, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_18from_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":1166
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, bint preserve_index=True,             # <<<<<<<<<<<<<<
 *                     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_18from_pandas(PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_df, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema, int __pyx_v_preserve_index, PyObject *__pyx_v_nthreads, PyObject *__pyx_v_columns, int __pyx_v_safe) {
  PyObject *__pyx_v_names = NULL;
  PyObject *__pyx_v_arrays = NULL;
  PyObject *__pyx_v_metadata = 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 *);
  __Pyx_RefNannySetupContext("from_pandas", 0);

  /* "pyarrow/table.pxi":1217
 *         <pyarrow.lib.Table object at 0x7f05d1fb1b40>
 *         """
 *         names, arrays, metadata = pdcompat.dataframe_to_arrays(             # <<<<<<<<<<<<<<
 *             df,
 *             schema=schema,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pdcompat); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dataframe_to_arrays); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1218
 *         """
 *         names, arrays, metadata = pdcompat.dataframe_to_arrays(
 *             df,             # <<<<<<<<<<<<<<
 *             schema=schema,
 *             preserve_index=preserve_index,
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_df);
  __Pyx_GIVEREF(__pyx_v_df);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_df);

  /* "pyarrow/table.pxi":1219
 *         names, arrays, metadata = pdcompat.dataframe_to_arrays(
 *             df,
 *             schema=schema,             # <<<<<<<<<<<<<<
 *             preserve_index=preserve_index,
 *             nthreads=nthreads,
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 1219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_schema, ((PyObject *)__pyx_v_schema)) < 0) __PYX_ERR(10, 1219, __pyx_L1_error)

  /* "pyarrow/table.pxi":1220
 *             df,
 *             schema=schema,
 *             preserve_index=preserve_index,             # <<<<<<<<<<<<<<
 *             nthreads=nthreads,
 *             columns=columns,
 */
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_preserve_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_preserve_index, __pyx_t_4) < 0) __PYX_ERR(10, 1219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/table.pxi":1221
 *             schema=schema,
 *             preserve_index=preserve_index,
 *             nthreads=nthreads,             # <<<<<<<<<<<<<<
 *             columns=columns,
 *             safe=safe
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_nthreads, __pyx_v_nthreads) < 0) __PYX_ERR(10, 1219, __pyx_L1_error)

  /* "pyarrow/table.pxi":1222
 *             preserve_index=preserve_index,
 *             nthreads=nthreads,
 *             columns=columns,             # <<<<<<<<<<<<<<
 *             safe=safe
 *         )
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_columns, __pyx_v_columns) < 0) __PYX_ERR(10, 1219, __pyx_L1_error)

  /* "pyarrow/table.pxi":1223
 *             nthreads=nthreads,
 *             columns=columns,
 *             safe=safe             # <<<<<<<<<<<<<<
 *         )
 *         return cls.from_arrays(arrays, names=names, metadata=metadata)
 */
  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_safe); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_safe, __pyx_t_4) < 0) __PYX_ERR(10, 1219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/table.pxi":1217
 *         <pyarrow.lib.Table object at 0x7f05d1fb1b40>
 *         """
 *         names, arrays, metadata = pdcompat.dataframe_to_arrays(             # <<<<<<<<<<<<<<
 *             df,
 *             schema=schema,
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1217, __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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  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 != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(10, 1217, __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_1 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_1 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 1217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #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(10, 1217, __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_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 1; __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 = 2; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(10, 1217, __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(10, 1217, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_names = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_arrays = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_metadata = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1225
 *             safe=safe
 *         )
 *         return cls.from_arrays(arrays, names=names, metadata=metadata)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_cls), __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1225, __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(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_names, __pyx_v_names) < 0) __PYX_ERR(10, 1225, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_metadata, __pyx_v_metadata) < 0) __PYX_ERR(10, 1225, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 1225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __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;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1166
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, bint preserve_index=True,             # <<<<<<<<<<<<<<
 *                     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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pyarrow.lib.Table.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_names);
  __Pyx_XDECREF(__pyx_v_arrays);
  __Pyx_XDECREF(__pyx_v_metadata);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1228
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, schema=None, dict metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays or columns
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_21from_arrays(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_20from_arrays[] = "Table.from_arrays(arrays, names=None, schema=None, dict metadata=None)\n\n        Construct a Table from Arrow arrays or columns\n\n        Parameters\n        ----------\n        arrays: list of pyarrow.Array or pyarrow.Column\n            Equal-length arrays that should form the table.\n        names: list of str, optional\n            Names for the table columns. If Columns passed, will be\n            inferred. If Arrays passed, this argument is required\n\n        Returns\n        -------\n        pyarrow.Table\n\n        ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_5Table_21from_arrays = {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_21from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_20from_arrays};
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_21from_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(10, 1228, __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 = ((PyObject*)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(10, 1228, __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:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_metadata), (&PyDict_Type), 1, "metadata", 1))) __PYX_ERR(10, 1228, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_20from_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_5Table_20from_arrays(PyObject *__pyx_v_arrays, PyObject *__pyx_v_names, PyObject *__pyx_v_schema, PyObject *__pyx_v_metadata) {
  std::vector<std::shared_ptr< arrow::Column> >  __pyx_v_columns;
  struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_cy_schema = 0;
  std::shared_ptr< arrow::Schema>  __pyx_v_c_schema;
  int __pyx_v_i;
  int __pyx_v_K;
  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;
  Py_ssize_t __pyx_t_5;
  std::shared_ptr< arrow::Schema>  __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  std::shared_ptr< arrow::Column>  __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("from_arrays", 0);

  /* "pyarrow/table.pxi":1250
 *             shared_ptr[CSchema] c_schema
 *             shared_ptr[CTable] table
 *             int i, K = <int> len(arrays)             # <<<<<<<<<<<<<<
 * 
 *         if schema is None:
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_arrays); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(10, 1250, __pyx_L1_error)
  __pyx_v_K = ((int)__pyx_t_1);

  /* "pyarrow/table.pxi":1252
 *             int i, K = <int> len(arrays)
 * 
 *         if schema is None:             # <<<<<<<<<<<<<<
 *             _schema_from_arrays(arrays, names, metadata, &c_schema)
 *         elif schema is not None:
 */
  __pyx_t_2 = (__pyx_v_schema == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":1253
 * 
 *         if schema is None:
 *             _schema_from_arrays(arrays, names, metadata, &c_schema)             # <<<<<<<<<<<<<<
 *         elif schema is not None:
 *             if names is not None:
 */
    __pyx_t_4 = __pyx_f_7pyarrow_3lib__schema_from_arrays(__pyx_v_arrays, __pyx_v_names, __pyx_v_metadata, (&__pyx_v_c_schema)); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":1252
 *             int i, K = <int> len(arrays)
 * 
 *         if schema is None:             # <<<<<<<<<<<<<<
 *             _schema_from_arrays(arrays, names, metadata, &c_schema)
 *         elif schema is not None:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/table.pxi":1254
 *         if schema is None:
 *             _schema_from_arrays(arrays, names, metadata, &c_schema)
 *         elif schema is not None:             # <<<<<<<<<<<<<<
 *             if names is not None:
 *                 raise ValueError('Cannot pass schema and arrays')
 */
  __pyx_t_3 = (__pyx_v_schema != Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/table.pxi":1255
 *             _schema_from_arrays(arrays, names, metadata, &c_schema)
 *         elif schema is not None:
 *             if names is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Cannot pass schema and arrays')
 *             cy_schema = schema
 */
    __pyx_t_2 = (__pyx_v_names != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (unlikely(__pyx_t_3)) {

      /* "pyarrow/table.pxi":1256
 *         elif schema is not None:
 *             if names is not None:
 *                 raise ValueError('Cannot pass schema and arrays')             # <<<<<<<<<<<<<<
 *             cy_schema = schema
 * 
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__108, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1256, __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(10, 1256, __pyx_L1_error)

      /* "pyarrow/table.pxi":1255
 *             _schema_from_arrays(arrays, names, metadata, &c_schema)
 *         elif schema is not None:
 *             if names is not None:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Cannot pass schema and arrays')
 *             cy_schema = schema
 */
    }

    /* "pyarrow/table.pxi":1257
 *             if names is not None:
 *                 raise ValueError('Cannot pass schema and arrays')
 *             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(10, 1257, __pyx_L1_error)
    __pyx_t_4 = __pyx_v_schema;
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_cy_schema = ((struct __pyx_obj_7pyarrow_3lib_Schema *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/table.pxi":1259
 *             cy_schema = schema
 * 
 *             if len(schema) != len(arrays):             # <<<<<<<<<<<<<<
 *                 raise ValueError('Schema and number of arrays unequal')
 * 
 */
    __pyx_t_1 = PyObject_Length(__pyx_v_schema); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(10, 1259, __pyx_L1_error)
    __pyx_t_5 = PyObject_Length(__pyx_v_arrays); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(10, 1259, __pyx_L1_error)
    __pyx_t_3 = ((__pyx_t_1 != __pyx_t_5) != 0);
    if (unlikely(__pyx_t_3)) {

      /* "pyarrow/table.pxi":1260
 * 
 *             if len(schema) != len(arrays):
 *                 raise ValueError('Schema and number of arrays unequal')             # <<<<<<<<<<<<<<
 * 
 *             c_schema = cy_schema.sp_schema
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__109, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1260, __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(10, 1260, __pyx_L1_error)

      /* "pyarrow/table.pxi":1259
 *             cy_schema = schema
 * 
 *             if len(schema) != len(arrays):             # <<<<<<<<<<<<<<
 *                 raise ValueError('Schema and number of arrays unequal')
 * 
 */
    }

    /* "pyarrow/table.pxi":1262
 *                 raise ValueError('Schema and number of arrays unequal')
 * 
 *             c_schema = cy_schema.sp_schema             # <<<<<<<<<<<<<<
 * 
 *         columns.reserve(K)
 */
    __pyx_t_6 = __pyx_v_cy_schema->sp_schema;
    __pyx_v_c_schema = __pyx_t_6;

    /* "pyarrow/table.pxi":1254
 *         if schema is None:
 *             _schema_from_arrays(arrays, names, metadata, &c_schema)
 *         elif schema is not None:             # <<<<<<<<<<<<<<
 *             if names is not None:
 *                 raise ValueError('Cannot pass schema and arrays')
 */
  }
  __pyx_L3:;

  /* "pyarrow/table.pxi":1264
 *             c_schema = cy_schema.sp_schema
 * 
 *         columns.reserve(K)             # <<<<<<<<<<<<<<
 * 
 *         for i in range(K):
 */
  __pyx_v_columns.reserve(__pyx_v_K);

  /* "pyarrow/table.pxi":1266
 *         columns.reserve(K)
 * 
 *         for i in range(K):             # <<<<<<<<<<<<<<
 *             if isinstance(arrays[i], Array):
 *                 columns.push_back(
 */
  __pyx_t_7 = __pyx_v_K;
  __pyx_t_8 = __pyx_t_7;
  for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
    __pyx_v_i = __pyx_t_9;

    /* "pyarrow/table.pxi":1267
 * 
 *         for i in range(K):
 *             if isinstance(arrays[i], Array):             # <<<<<<<<<<<<<<
 *                 columns.push_back(
 *                     make_shared[CColumn](
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_arrays, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_TypeCheck(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Array); 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (__pyx_t_2) {

      /* "pyarrow/table.pxi":1271
 *                     make_shared[CColumn](
 *                         c_schema.get().field(i),
 *                         (<Array> arrays[i]).sp_array             # <<<<<<<<<<<<<<
 *                     )
 *                 )
 */
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_arrays, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1271, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/table.pxi":1269
 *             if isinstance(arrays[i], Array):
 *                 columns.push_back(
 *                     make_shared[CColumn](             # <<<<<<<<<<<<<<
 *                         c_schema.get().field(i),
 *                         (<Array> arrays[i]).sp_array
 */
      try {
        __pyx_t_10 = std::make_shared< arrow::Column>(__pyx_v_c_schema.get()->field(__pyx_v_i), ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_4)->sp_array);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(10, 1269, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/table.pxi":1268
 *         for i in range(K):
 *             if isinstance(arrays[i], Array):
 *                 columns.push_back(             # <<<<<<<<<<<<<<
 *                     make_shared[CColumn](
 *                         c_schema.get().field(i),
 */
      try {
        __pyx_v_columns.push_back(__pyx_t_10);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(10, 1268, __pyx_L1_error)
      }

      /* "pyarrow/table.pxi":1267
 * 
 *         for i in range(K):
 *             if isinstance(arrays[i], Array):             # <<<<<<<<<<<<<<
 *                 columns.push_back(
 *                     make_shared[CColumn](
 */
      goto __pyx_L8;
    }

    /* "pyarrow/table.pxi":1274
 *                     )
 *                 )
 *             elif isinstance(arrays[i], ChunkedArray):             # <<<<<<<<<<<<<<
 *                 columns.push_back(
 *                     make_shared[CColumn](
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_arrays, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_TypeCheck(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_ChunkedArray); 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "pyarrow/table.pxi":1278
 *                     make_shared[CColumn](
 *                         c_schema.get().field(i),
 *                         (<ChunkedArray> arrays[i]).sp_chunked_array             # <<<<<<<<<<<<<<
 *                     )
 *                 )
 */
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_arrays, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/table.pxi":1276
 *             elif isinstance(arrays[i], ChunkedArray):
 *                 columns.push_back(
 *                     make_shared[CColumn](             # <<<<<<<<<<<<<<
 *                         c_schema.get().field(i),
 *                         (<ChunkedArray> arrays[i]).sp_chunked_array
 */
      try {
        __pyx_t_10 = std::make_shared< arrow::Column>(__pyx_v_c_schema.get()->field(__pyx_v_i), ((struct __pyx_obj_7pyarrow_3lib_ChunkedArray *)__pyx_t_4)->sp_chunked_array);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(10, 1276, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/table.pxi":1275
 *                 )
 *             elif isinstance(arrays[i], ChunkedArray):
 *                 columns.push_back(             # <<<<<<<<<<<<<<
 *                     make_shared[CColumn](
 *                         c_schema.get().field(i),
 */
      try {
        __pyx_v_columns.push_back(__pyx_t_10);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(10, 1275, __pyx_L1_error)
      }

      /* "pyarrow/table.pxi":1274
 *                     )
 *                 )
 *             elif isinstance(arrays[i], ChunkedArray):             # <<<<<<<<<<<<<<
 *                 columns.push_back(
 *                     make_shared[CColumn](
 */
      goto __pyx_L8;
    }

    /* "pyarrow/table.pxi":1281
 *                     )
 *                 )
 *             elif isinstance(arrays[i], Column):             # <<<<<<<<<<<<<<
 *                 # Make sure schema field and column are consistent
 *                 columns.push_back(
 */
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_arrays, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1281, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_TypeCheck(__pyx_t_4, __pyx_ptype_7pyarrow_3lib_Column); 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (likely(__pyx_t_2)) {

      /* "pyarrow/table.pxi":1286
 *                     make_shared[CColumn](
 *                         c_schema.get().field(i),
 *                         (<Column> arrays[i]).sp_column.get().data()             # <<<<<<<<<<<<<<
 *                     )
 *                 )
 */
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_arrays, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1286, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/table.pxi":1284
 *                 # Make sure schema field and column are consistent
 *                 columns.push_back(
 *                     make_shared[CColumn](             # <<<<<<<<<<<<<<
 *                         c_schema.get().field(i),
 *                         (<Column> arrays[i]).sp_column.get().data()
 */
      try {
        __pyx_t_10 = std::make_shared< arrow::Column>(__pyx_v_c_schema.get()->field(__pyx_v_i), ((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_t_4)->sp_column.get()->data());
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(10, 1284, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "pyarrow/table.pxi":1283
 *             elif isinstance(arrays[i], Column):
 *                 # Make sure schema field and column are consistent
 *                 columns.push_back(             # <<<<<<<<<<<<<<
 *                     make_shared[CColumn](
 *                         c_schema.get().field(i),
 */
      try {
        __pyx_v_columns.push_back(__pyx_t_10);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(10, 1283, __pyx_L1_error)
      }

      /* "pyarrow/table.pxi":1281
 *                     )
 *                 )
 *             elif isinstance(arrays[i], Column):             # <<<<<<<<<<<<<<
 *                 # Make sure schema field and column are consistent
 *                 columns.push_back(
 */
      goto __pyx_L8;
    }

    /* "pyarrow/table.pxi":1290
 *                 )
 *             else:
 *                 raise TypeError(type(arrays[i]))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(CTable.Make(c_schema, columns))
 */
    /*else*/ {
      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_arrays, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, ((PyObject *)Py_TYPE(__pyx_t_4))); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 1290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_11, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __PYX_ERR(10, 1290, __pyx_L1_error)
    }
    __pyx_L8:;
  }

  /* "pyarrow/table.pxi":1292
 *                 raise TypeError(type(arrays[i]))
 * 
 *         return pyarrow_wrap_table(CTable.Make(c_schema, columns))             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_11 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table( arrow::Table::Make(__pyx_v_c_schema, __pyx_v_columns)); if (unlikely(!__pyx_t_11)) __PYX_ERR(10, 1292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_r = __pyx_t_11;
  __pyx_t_11 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1228
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, schema=None, dict metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays or columns
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("pyarrow.lib.Table.from_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_cy_schema);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1295
 * 
 *     @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_23from_batches(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_22from_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_23from_batches = {"from_batches", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_23from_batches, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_22from_batches};
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_23from_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(10, 1295, __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(10, 1295, __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(10, 1295, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_22from_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_22from_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":1316
 *             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(10, 1316, __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, 1316, __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, 1316, __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, 1316, __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, 1316, __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, 1316, __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, 1316, __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(10, 1316, __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":1317
 * 
 *         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(10, 1317, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":1316
 *             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":1319
 *             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":1320
 * 
 *         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":1321
 *         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__110, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1321, __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, 1321, __pyx_L1_error)

      /* "pyarrow/table.pxi":1320
 * 
 *         if schema is None:
 *             if c_batches.size() == 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError('Must pass schema, or at least '
 *                                  'one RecordBatch')
 */
    }

    /* "pyarrow/table.pxi":1323
 *                 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":1319
 *             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":1325
 *             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":1327
 *             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":1328
 * 
 *         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(10, 1328, __pyx_L8_error)
      }

      /* "pyarrow/table.pxi":1327
 *             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":1331
 *                                                   &c_table))
 * 
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     def to_batches(self, chunksize=None):
 */
  __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(10, 1331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1295
 * 
 *     @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":1333
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def to_batches(self, chunksize=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert Table to list of (contiguous) RecordBatch objects, with optimal
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_25to_batches(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_24to_batches[] = "Table.to_batches(self, chunksize=None)\n\n        Convert Table to list of (contiguous) RecordBatch objects, with optimal\n        maximum chunk size\n\n        Parameters\n        ----------\n        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_25to_batches(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_chunksize = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_batches (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_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_chunksize);
          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_batches") < 0)) __PYX_ERR(10, 1333, __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_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(10, 1333, __pyx_L3_error)
  __pyx_L3_error:;
  __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_24to_batches(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_chunksize);

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_24to_batches(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_chunksize) {
  std::unique_ptr<arrow::TableBatchReader>  __pyx_v_reader;
  int64_t __pyx_v_c_chunksize;
  PyObject *__pyx_v_result = 0;
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_batch;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int64_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("to_batches", 0);

  /* "pyarrow/table.pxi":1351
 *             unique_ptr[TableBatchReader] reader
 *             int64_t c_chunksize
 *             list result = []             # <<<<<<<<<<<<<<
 *             shared_ptr[CRecordBatch] batch
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1354
 *             shared_ptr[CRecordBatch] batch
 * 
 *         reader.reset(new TableBatchReader(deref(self.table)))             # <<<<<<<<<<<<<<
 * 
 *         if chunksize is not None:
 */
  __pyx_v_reader.reset(new arrow::TableBatchReader((*__pyx_v_self->table)));

  /* "pyarrow/table.pxi":1356
 *         reader.reset(new TableBatchReader(deref(self.table)))
 * 
 *         if chunksize is not None:             # <<<<<<<<<<<<<<
 *             c_chunksize = chunksize
 *             reader.get().set_chunksize(c_chunksize)
 */
  __pyx_t_2 = (__pyx_v_chunksize != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/table.pxi":1357
 * 
 *         if chunksize is not None:
 *             c_chunksize = chunksize             # <<<<<<<<<<<<<<
 *             reader.get().set_chunksize(c_chunksize)
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_v_chunksize); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(10, 1357, __pyx_L1_error)
    __pyx_v_c_chunksize = __pyx_t_4;

    /* "pyarrow/table.pxi":1358
 *         if chunksize is not None:
 *             c_chunksize = chunksize
 *             reader.get().set_chunksize(c_chunksize)             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __pyx_v_reader.get()->set_chunksize(__pyx_v_c_chunksize);

    /* "pyarrow/table.pxi":1356
 *         reader.reset(new TableBatchReader(deref(self.table)))
 * 
 *         if chunksize is not None:             # <<<<<<<<<<<<<<
 *             c_chunksize = chunksize
 *             reader.get().set_chunksize(c_chunksize)
 */
  }

  /* "pyarrow/table.pxi":1360
 *             reader.get().set_chunksize(c_chunksize)
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(reader.get().ReadNext(&batch))
 */
  while (1) {

    /* "pyarrow/table.pxi":1361
 * 
 *         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":1362
 *         while True:
 *             with nogil:
 *                 check_status(reader.get().ReadNext(&batch))             # <<<<<<<<<<<<<<
 * 
 *             if batch.get() == NULL:
 */
          __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_reader.get()->ReadNext((&__pyx_v_batch))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(10, 1362, __pyx_L9_error)
        }

        /* "pyarrow/table.pxi":1361
 * 
 *         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_L10;
          }
          __pyx_L9_error: {
            #ifdef WITH_THREAD
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            #endif
            goto __pyx_L1_error;
          }
          __pyx_L10:;
        }
    }

    /* "pyarrow/table.pxi":1364
 *                 check_status(reader.get().ReadNext(&batch))
 * 
 *             if batch.get() == NULL:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_3 = ((__pyx_v_batch.get() == NULL) != 0);
    if (__pyx_t_3) {

      /* "pyarrow/table.pxi":1365
 * 
 *             if batch.get() == NULL:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             result.append(pyarrow_wrap_batch(batch))
 */
      goto __pyx_L5_break;

      /* "pyarrow/table.pxi":1364
 *                 check_status(reader.get().ReadNext(&batch))
 * 
 *             if batch.get() == NULL:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "pyarrow/table.pxi":1367
 *                 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(10, 1367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(10, 1367, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L5_break:;

  /* "pyarrow/table.pxi":1369
 *             result.append(pyarrow_wrap_batch(batch))
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def to_pandas(self, MemoryPool memory_pool=None, categories=None,
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1333
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def to_batches(self, chunksize=None):             # <<<<<<<<<<<<<<
 *         """
 *         Convert Table to list of (contiguous) RecordBatch objects, with optimal
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyarrow.lib.Table.to_batches", __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/table.pxi":1371
 *         return result
 * 
 *     def to_pandas(self, MemoryPool memory_pool=None, categories=None,             # <<<<<<<<<<<<<<
 *                   bint strings_to_categorical=False, bint zero_copy_only=False,
 *                   bint integer_object_nulls=False, bint date_as_object=False,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_27to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_26to_pandas[] = "Table.to_pandas(self, MemoryPool memory_pool=None, categories=None, bool strings_to_categorical=False, bool zero_copy_only=False, bool integer_object_nulls=False, bool date_as_object=False, bool use_threads=True)\n\n        Convert the arrow::Table to a pandas DataFrame\n\n        Parameters\n        ----------\n        memory_pool: MemoryPool, optional\n            Specific memory pool to use to allocate casted columns\n        categories: list, default empty\n            List of columns that should be returned as pandas.Categorical\n        strings_to_categorical : boolean, default False\n            Encode string (UTF8) and binary types to pandas.Categorical\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\n        Returns\n        -------\n        pandas.DataFrame\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_27to_pandas(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_MemoryPool *__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;
  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,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[0] = (PyObject *)((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)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  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--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "to_pandas") < 0)) __PYX_ERR(10, 1371, __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);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_memory_pool = ((struct __pyx_obj_7pyarrow_3lib_MemoryPool *)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(10, 1372, __pyx_L3_error)
    } else {

      /* "pyarrow/table.pxi":1372
 * 
 *     def to_pandas(self, MemoryPool memory_pool=None, categories=None,
 *                   bint strings_to_categorical=False, bint zero_copy_only=False,             # <<<<<<<<<<<<<<
 *                   bint integer_object_nulls=False, bint date_as_object=False,
 *                   bint use_threads=True):
 */
      __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(10, 1372, __pyx_L3_error)
    } else {
      __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(10, 1373, __pyx_L3_error)
    } else {

      /* "pyarrow/table.pxi":1373
 *     def to_pandas(self, MemoryPool memory_pool=None, categories=None,
 *                   bint strings_to_categorical=False, bint zero_copy_only=False,
 *                   bint integer_object_nulls=False, bint date_as_object=False,             # <<<<<<<<<<<<<<
 *                   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(10, 1373, __pyx_L3_error)
    } else {
      __pyx_v_date_as_object = ((int)0);
    }
    if (values[6]) {
      __pyx_v_use_threads = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_use_threads == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 1374, __pyx_L3_error)
    } else {

      /* "pyarrow/table.pxi":1374
 *                   bint strings_to_categorical=False, bint zero_copy_only=False,
 *                   bint integer_object_nulls=False, bint date_as_object=False,
 *                   bint use_threads=True):             # <<<<<<<<<<<<<<
 *         """
 *         Convert the arrow::Table to a pandas DataFrame
 */
      __pyx_v_use_threads = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("to_pandas", 0, 0, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 1371, __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:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_memory_pool), __pyx_ptype_7pyarrow_3lib_MemoryPool, 1, "memory_pool", 0))) __PYX_ERR(10, 1371, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_26to_pandas(((struct __pyx_obj_7pyarrow_3lib_Table *)__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);

  /* "pyarrow/table.pxi":1371
 *         return result
 * 
 *     def to_pandas(self, MemoryPool memory_pool=None, categories=None,             # <<<<<<<<<<<<<<
 *                   bint strings_to_categorical=False, bint zero_copy_only=False,
 *                   bint integer_object_nulls=False, bint date_as_object=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_5Table_26to_pandas(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_MemoryPool *__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) {
  struct arrow::py::PandasOptions __pyx_v_options;
  PyObject *__pyx_v_mgr = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct arrow::py::PandasOptions __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("to_pandas", 0);

  /* "pyarrow/table.pxi":1404
 * 
 *         options = PandasOptions(
 *             strings_to_categorical=strings_to_categorical,             # <<<<<<<<<<<<<<
 *             zero_copy_only=zero_copy_only,
 *             integer_object_nulls=integer_object_nulls,
 */
  __pyx_t_1.strings_to_categorical = __pyx_v_strings_to_categorical;

  /* "pyarrow/table.pxi":1405
 *         options = PandasOptions(
 *             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_1.zero_copy_only = __pyx_v_zero_copy_only;

  /* "pyarrow/table.pxi":1406
 *             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_1.integer_object_nulls = __pyx_v_integer_object_nulls;

  /* "pyarrow/table.pxi":1407
 *             zero_copy_only=zero_copy_only,
 *             integer_object_nulls=integer_object_nulls,
 *             date_as_object=date_as_object,             # <<<<<<<<<<<<<<
 *             use_threads=use_threads)
 * 
 */
  __pyx_t_1.date_as_object = __pyx_v_date_as_object;

  /* "pyarrow/table.pxi":1408
 *             integer_object_nulls=integer_object_nulls,
 *             date_as_object=date_as_object,
 *             use_threads=use_threads)             # <<<<<<<<<<<<<<
 * 
 *         mgr = pdcompat.table_to_blockmanager(options, self, memory_pool,
 */
  __pyx_t_1.use_threads = __pyx_v_use_threads;
  __pyx_v_options = __pyx_t_1;

  /* "pyarrow/table.pxi":1410
 *             use_threads=use_threads)
 * 
 *         mgr = pdcompat.table_to_blockmanager(options, self, memory_pool,             # <<<<<<<<<<<<<<
 *                                              categories)
 *         return pd.DataFrame(mgr)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pdcompat); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 1410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_table_to_blockmanager); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __pyx_convert__to_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions(__pyx_v_options); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 1410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pyarrow/table.pxi":1411
 * 
 *         mgr = pdcompat.table_to_blockmanager(options, self, memory_pool,
 *                                              categories)             # <<<<<<<<<<<<<<
 *         return pd.DataFrame(mgr)
 * 
 */
  __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[5] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_memory_pool), __pyx_v_categories};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1410, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_memory_pool), __pyx_v_categories};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1410, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 1410, __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_3);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(((PyObject *)__pyx_v_memory_pool));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_memory_pool));
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_memory_pool));
    __Pyx_INCREF(__pyx_v_categories);
    __Pyx_GIVEREF(__pyx_v_categories);
    PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_categories);
    __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1410, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_mgr = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/table.pxi":1412
 *         mgr = pdcompat.table_to_blockmanager(options, self, memory_pool,
 *                                              categories)
 *         return pd.DataFrame(mgr)             # <<<<<<<<<<<<<<
 * 
 *     def to_pydict(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pd); if (unlikely(!__pyx_t_4)) __PYX_ERR(10, 1412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 1412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_4, __pyx_v_mgr) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_mgr);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1371
 *         return result
 * 
 *     def to_pandas(self, MemoryPool memory_pool=None, categories=None,             # <<<<<<<<<<<<<<
 *                   bint strings_to_categorical=False, bint zero_copy_only=False,
 *                   bint integer_object_nulls=False, bint date_as_object=False,
 */

  /* 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.Table.to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_mgr);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1414
 *         return pd.DataFrame(mgr)
 * 
 *     def to_pydict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Converted the arrow::Table to an OrderedDict
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_29to_pydict(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_28to_pydict[] = "Table.to_pydict(self)\n\n        Converted the arrow::Table to an OrderedDict\n\n        Returns\n        -------\n        OrderedDict\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_29to_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_28to_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_28to_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_Column *__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":1424
 *         cdef:
 *             size_t i
 *             size_t num_columns = self.table.num_columns()             # <<<<<<<<<<<<<<
 *             list entries = []
 *             Column column
 */
  __pyx_v_num_columns = __pyx_v_self->table->num_columns();

  /* "pyarrow/table.pxi":1425
 *             size_t i
 *             size_t num_columns = self.table.num_columns()
 *             list entries = []             # <<<<<<<<<<<<<<
 *             Column column
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_entries = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1428
 *             Column column
 * 
 *         for i in range(num_columns):             # <<<<<<<<<<<<<<
 *             column = self.column(i)
 *             entries.append((column.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":1429
 * 
 *         for i in range(num_columns):
 *             column = self.column(i)             # <<<<<<<<<<<<<<
 *             entries.append((column.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(10, 1429, __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(10, 1429, __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(10, 1429, __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_Column))))) __PYX_ERR(10, 1429, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_column, ((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "pyarrow/table.pxi":1430
 *         for i in range(num_columns):
 *             column = self.column(i)
 *             entries.append((column.name, column.to_pylist()))             # <<<<<<<<<<<<<<
 * 
 *         return OrderedDict(entries)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_column), __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_column), __pyx_n_s_to_pylist); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 1430, __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(10, 1430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 1430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_t_6); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(10, 1430, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }

  /* "pyarrow/table.pxi":1432
 *             entries.append((column.name, column.to_pylist()))
 * 
 *         return OrderedDict(entries)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_OrderedDict); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 1432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(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_6 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_entries) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_entries);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 1432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1414
 *         return pd.DataFrame(mgr)
 * 
 *     def to_pydict(self):             # <<<<<<<<<<<<<<
 *         """
 *         Converted the arrow::Table to an 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":1435
 * 
 *     @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":1443
 *         pyarrow.Schema
 *         """
 *         return pyarrow_wrap_schema(self.table.schema())             # <<<<<<<<<<<<<<
 * 
 *     def column(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(10, 1443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1435
 * 
 *     @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":1445
 *         return pyarrow_wrap_schema(self.table.schema())
 * 
 *     def column(self, i):             # <<<<<<<<<<<<<<
 *         """
 *         Select a column by its column name, or numeric index.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_31column(PyObject *__pyx_v_self, PyObject *__pyx_v_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_30column[] = "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.Column\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_31column(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_30column(((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_30column(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":1457
 *         pyarrow.Column
 *         """
 *         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(10, 1457, __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(10, 1457, __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(10, 1457, __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":1458
 *         """
 *         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(10, 1458, __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(10, 1458, __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(10, 1458, __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":1459
 *         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(10, 1459, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(10, 1459, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(__pyx_t_4)) {

      /* "pyarrow/table.pxi":1460
 *             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_s_Column_does_not_exist_in_table, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 1460, __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(10, 1460, __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(10, 1460, __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(10, 1460, __pyx_L1_error)

      /* "pyarrow/table.pxi":1459
 *         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":1462
 *                 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(10, 1462, __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(10, 1462, __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":1457
 *         pyarrow.Column
 *         """
 *         if isinstance(i, six.string_types):             # <<<<<<<<<<<<<<
 *             field_index = self.schema.get_field_index(i)
 *             if field_index < 0:
 */
  }

  /* "pyarrow/table.pxi":1463
 *             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(10, 1463, __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(10, 1463, __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(10, 1463, __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":1464
 *                 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(10, 1464, __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(10, 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;
    goto __pyx_L0;

    /* "pyarrow/table.pxi":1463
 *             else:
 *                 return self._column(field_index)
 *         elif isinstance(i, six.integer_types):             # <<<<<<<<<<<<<<
 *             return self._column(i)
 *         else:
 */
  }

  /* "pyarrow/table.pxi":1466
 *             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__111, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1466, __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(10, 1466, __pyx_L1_error)
  }

  /* "pyarrow/table.pxi":1445
 *         return pyarrow_wrap_schema(self.table.schema())
 * 
 *     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":1468
 *             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_33_column(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_32_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.Column\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_33_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(10, 1468, __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_32_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_32_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i) {
  int __pyx_v_num_columns;
  int __pyx_v_index;
  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;
  __Pyx_RefNannySetupContext("_column", 0);

  /* "pyarrow/table.pxi":1481
 *         """
 *         cdef:
 *             int num_columns = self.num_columns             # <<<<<<<<<<<<<<
 *             int index
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_num_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1481, __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(10, 1481, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_columns = __pyx_t_2;

  /* "pyarrow/table.pxi":1484
 *             int index
 * 
 *         if not -num_columns <= i < num_columns:             # <<<<<<<<<<<<<<
 *             raise IndexError(
 *                 'Table column index {:d} is out of range'.format(i)
 */
  __pyx_t_3 = ((-__pyx_v_num_columns) <= __pyx_v_i);
  if (__pyx_t_3) {
    __pyx_t_3 = (__pyx_v_i < __pyx_v_num_columns);
  }
  __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
  if (unlikely(__pyx_t_4)) {

    /* "pyarrow/table.pxi":1486
 *         if not -num_columns <= i < num_columns:
 *             raise IndexError(
 *                 'Table column index {:d} is out of range'.format(i)             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Table_column_index_d_is_out_of_r, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 1486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 1486, __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(10, 1486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/table.pxi":1485
 * 
 *         if not -num_columns <= i < num_columns:
 *             raise IndexError(             # <<<<<<<<<<<<<<
 *                 'Table column index {:d} is out of range'.format(i)
 *             )
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 1485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __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(10, 1485, __pyx_L1_error)

    /* "pyarrow/table.pxi":1484
 *             int index
 * 
 *         if not -num_columns <= i < num_columns:             # <<<<<<<<<<<<<<
 *             raise IndexError(
 *                 'Table column index {:d} is out of range'.format(i)
 */
  }

  /* "pyarrow/table.pxi":1489
 *             )
 * 
 *         index = i if i >= 0 else num_columns + i             # <<<<<<<<<<<<<<
 *         assert index >= 0
 * 
 */
  if (((__pyx_v_i >= 0) != 0)) {
    __pyx_t_2 = __pyx_v_i;
  } else {
    __pyx_t_2 = (__pyx_v_num_columns + __pyx_v_i);
  }
  __pyx_v_index = __pyx_t_2;

  /* "pyarrow/table.pxi":1490
 * 
 *         index = i if i >= 0 else num_columns + i
 *         assert index >= 0             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_column(self.table.column(index))
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    if (unlikely(!((__pyx_v_index >= 0) != 0))) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(10, 1490, __pyx_L1_error)
    }
  }
  #endif

  /* "pyarrow/table.pxi":1492
 *         assert index >= 0
 * 
 *         return pyarrow_wrap_column(self.table.column(index))             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_column(__pyx_v_self->table->column(__pyx_v_index)); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 1492, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1468
 *             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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyarrow.lib.Table._column", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1494
 *         return pyarrow_wrap_column(self.table.column(index))
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         cdef int index = <int> _normalize_index(key, self.num_columns)
 *         return self.column(index)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_35__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_35__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_34__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_34__getitem__(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, PyObject *__pyx_v_key) {
  int __pyx_v_index;
  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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pyarrow/table.pxi":1495
 * 
 *     def __getitem__(self, key):
 *         cdef int index = <int> _normalize_index(key, self.num_columns)             # <<<<<<<<<<<<<<
 *         return self.column(index)
 * 
 */
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(10, 1495, __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(10, 1495, __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(10, 1495, __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(10, 1495, __pyx_L1_error)
  __pyx_v_index = ((int)__pyx_t_4);

  /* "pyarrow/table.pxi":1496
 *     def __getitem__(self, key):
 *         cdef int index = <int> _normalize_index(key, self.num_columns)
 *         return self.column(index)             # <<<<<<<<<<<<<<
 * 
 *     def itercolumns(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 1496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 1496, __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_2 = (__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_2)) __PYX_ERR(10, 1496, __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":1494
 *         return pyarrow_wrap_column(self.table.column(index))
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         cdef int index = <int> _normalize_index(key, self.num_columns)
 *         return self.column(index)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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;
}
static PyObject *__pyx_gb_7pyarrow_3lib_5Table_38generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/table.pxi":1498
 *         return self.column(index)
 * 
 *     def itercolumns(self):             # <<<<<<<<<<<<<<
 *         """
 *         Iterator over all columns in their numerical order
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_37itercolumns(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_36itercolumns[] = "Table.itercolumns(self)\n\n        Iterator over all columns in their numerical order\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_37itercolumns(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_36itercolumns(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_5Table_36itercolumns(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_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_7_itercolumns *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_7_itercolumns(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_7_itercolumns, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_itercolumns *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(10, 1498, __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_38generator7, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_itercolumns, __pyx_n_s_Table_itercolumns, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(10, 1498, __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_38generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_itercolumns *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_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(10, 1498, __pyx_L1_error)

  /* "pyarrow/table.pxi":1502
 *         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(10, 1502, __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(10, 1502, __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(10, 1502, __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(10, 1502, __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(10, 1502, __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(10, 1502, __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(10, 1502, __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(10, 1502, __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(10, 1502, __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":1503
 *         """
 *         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); if (unlikely(!__pyx_t_5)) __PYX_ERR(10, 1503, __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(10, 1503, __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(10, 1503, __pyx_L1_error)

    /* "pyarrow/table.pxi":1502
 *         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":1498
 *         return self.column(index)
 * 
 *     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":1506
 * 
 *     @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_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":1514
 *         list of pa.Column
 *         """
 *         return [self._column(i) for i in range(self.num_columns)]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 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(10, 1514, __pyx_L1_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(10, 1514, __pyx_L1_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(10, 1514, __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(10, 1514, __pyx_L1_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(10, 1514, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 1514, __pyx_L1_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(10, 1514, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 1514, __pyx_L1_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(10, 1514, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__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(10, 1514, __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_3 = (__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_3)) __PYX_ERR(10, 1514, __pyx_L1_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(10, 1514, __pyx_L1_error)
    __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/table.pxi":1506
 * 
 *     @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_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/table.pxi":1517
 * 
 *     @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":1525
 *         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(10, 1525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1517
 * 
 *     @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":1528
 * 
 *     @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":1539
 *         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(10, 1539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1528
 * 
 *     @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":1541
 *         return self.table.num_rows()
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.num_rows
 * 
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7pyarrow_3lib_5Table_40__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_5Table_40__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_39__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_39__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":1542
 * 
 *     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(10, 1542, __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(10, 1542, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1541
 *         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":1545
 * 
 *     @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":1553
 *         (int, int)
 *         """
 *         return (self.num_rows, self.num_columns)             # <<<<<<<<<<<<<<
 * 
 *     def add_column(self, int i, Column column):
 */
  __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(10, 1553, __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(10, 1553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(10, 1553, __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":1545
 * 
 *     @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":1555
 *         return (self.num_rows, self.num_columns)
 * 
 *     def add_column(self, int i, Column column):             # <<<<<<<<<<<<<<
 *         """
 *         Add column to Table at position. Returns new table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_42add_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_41add_column[] = "Table.add_column(self, int i, Column column)\n\n        Add column to Table at position. Returns new table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_42add_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_Column *__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_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_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_column)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("add_column", 1, 2, 2, 1); __PYX_ERR(10, 1555, __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(10, 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_i = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_i == (int)-1) && PyErr_Occurred())) __PYX_ERR(10, 1555, __pyx_L3_error)
    __pyx_v_column = ((struct __pyx_obj_7pyarrow_3lib_Column *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_column", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 1555, __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:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_column), __pyx_ptype_7pyarrow_3lib_Column, 1, "column", 0))) __PYX_ERR(10, 1555, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_41add_column(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_i, __pyx_v_column);

  /* 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_41add_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i, struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_column) {
  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("add_column", 0);

  /* "pyarrow/table.pxi":1561
 *         cdef shared_ptr[CTable] c_table
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.AddColumn(i, column.sp_column, &c_table))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1562
 * 
 *         with nogil:
 *             check_status(self.table.AddColumn(i, column.sp_column, &c_table))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(c_table)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->AddColumn(__pyx_v_i, __pyx_v_column->sp_column, (&__pyx_v_c_table))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 1562, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":1561
 *         cdef shared_ptr[CTable] c_table
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.AddColumn(i, column.sp_column, &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":1564
 *             check_status(self.table.AddColumn(i, column.sp_column, &c_table))
 * 
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     def append_column(self, Column 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(10, 1564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1555
 *         return (self.num_rows, self.num_columns)
 * 
 *     def add_column(self, int i, Column column):             # <<<<<<<<<<<<<<
 *         """
 *         Add column to Table at position. Returns new table
 */

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

/* "pyarrow/table.pxi":1566
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def append_column(self, Column column):             # <<<<<<<<<<<<<<
 *         """
 *         Append column at end of columns. Returns new table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_44append_column(PyObject *__pyx_v_self, PyObject *__pyx_v_column); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_43append_column[] = "Table.append_column(self, Column column)\n\n        Append column at end of columns. Returns new table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_44append_column(PyObject *__pyx_v_self, PyObject *__pyx_v_column) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("append_column (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_column), __pyx_ptype_7pyarrow_3lib_Column, 1, "column", 0))) __PYX_ERR(10, 1566, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_43append_column(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), ((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_v_column));

  /* 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_43append_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Column *__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":1570
 *         Append column at end of columns. Returns new table
 *         """
 *         return self.add_column(self.num_columns, 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(10, 1570, __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(10, 1570, __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_column)};
    __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(10, 1570, __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_column)};
    __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(10, 1570, __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(10, 1570, __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_column));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_column));
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, ((PyObject *)__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(10, 1570, __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":1566
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def append_column(self, Column 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":1572
 *         return self.add_column(self.num_columns, column)
 * 
 *     def remove_column(self, int i):             # <<<<<<<<<<<<<<
 *         """
 *         Create new Table with the indicated column removed
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_46remove_column(PyObject *__pyx_v_self, PyObject *__pyx_arg_i); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_45remove_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_46remove_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(10, 1572, __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_45remove_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_45remove_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":1578
 *         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":1579
 * 
 *         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(10, 1579, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":1578
 *         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":1581
 *             check_status(self.table.RemoveColumn(i, &c_table))
 * 
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     def set_column(self, int i, Column 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(10, 1581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1572
 *         return self.add_column(self.num_columns, 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":1583
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def set_column(self, int i, Column column):             # <<<<<<<<<<<<<<
 *         """
 *         Replace column in Table at position. Returns new table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_48set_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_47set_column[] = "Table.set_column(self, int i, Column column)\n\n        Replace column in Table at position. Returns new table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_5Table_48set_column(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_i;
  struct __pyx_obj_7pyarrow_3lib_Column *__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_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_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_column)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_column", 1, 2, 2, 1); __PYX_ERR(10, 1583, __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(10, 1583, __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(10, 1583, __pyx_L3_error)
    __pyx_v_column = ((struct __pyx_obj_7pyarrow_3lib_Column *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_column", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(10, 1583, __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:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_column), __pyx_ptype_7pyarrow_3lib_Column, 1, "column", 0))) __PYX_ERR(10, 1583, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_5Table_47set_column(((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_v_self), __pyx_v_i, __pyx_v_column);

  /* 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_47set_column(struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_self, int __pyx_v_i, struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_column) {
  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("set_column", 0);

  /* "pyarrow/table.pxi":1589
 *         cdef shared_ptr[CTable] c_table
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.SetColumn(i, column.sp_column, &c_table))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1590
 * 
 *         with nogil:
 *             check_status(self.table.SetColumn(i, column.sp_column, &c_table))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_table(c_table)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->table->SetColumn(__pyx_v_i, __pyx_v_column->sp_column, (&__pyx_v_c_table))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(10, 1590, __pyx_L4_error)
      }

      /* "pyarrow/table.pxi":1589
 *         cdef shared_ptr[CTable] c_table
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.table.SetColumn(i, column.sp_column, &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":1592
 *             check_status(self.table.SetColumn(i, column.sp_column, &c_table))
 * 
 *         return pyarrow_wrap_table(c_table)             # <<<<<<<<<<<<<<
 * 
 *     def drop(self, columns):
 */
  __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(10, 1592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1583
 *         return pyarrow_wrap_table(c_table)
 * 
 *     def set_column(self, int i, Column column):             # <<<<<<<<<<<<<<
 *         """
 *         Replace column in Table at position. Returns new table
 */

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

/* "pyarrow/table.pxi":1594
 *         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_50drop(PyObject *__pyx_v_self, PyObject *__pyx_v_columns); /*proto*/
static char __pyx_doc_7pyarrow_3lib_5Table_49drop[] = "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_50drop(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_49drop(((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_49drop(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":1602
 *         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(10, 1602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_indices = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1603
 *         """
 *         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(10, 1603, __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, 1603, __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, 1603, __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, 1603, __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, 1603, __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, 1603, __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, 1603, __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":1604
 *         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(10, 1604, __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(10, 1604, __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(10, 1604, __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":1605
 *         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(10, 1605, __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(10, 1605, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(__pyx_t_7)) {

      /* "pyarrow/table.pxi":1606
 *             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_s_Column_r_not_found, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(10, 1606, __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(10, 1606, __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(10, 1606, __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(10, 1606, __pyx_L1_error)

      /* "pyarrow/table.pxi":1605
 *         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":1607
 *             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(10, 1607, __pyx_L1_error)

    /* "pyarrow/table.pxi":1603
 *         """
 *         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":1609
 *             indices.append(idx)
 * 
 *         indices.sort()             # <<<<<<<<<<<<<<
 *         indices.reverse()
 * 
 */
  __pyx_t_8 = PyList_Sort(__pyx_v_indices); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(10, 1609, __pyx_L1_error)

  /* "pyarrow/table.pxi":1610
 * 
 *         indices.sort()
 *         indices.reverse()             # <<<<<<<<<<<<<<
 * 
 *         table = self
 */
  __pyx_t_8 = PyList_Reverse(__pyx_v_indices); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(10, 1610, __pyx_L1_error)

  /* "pyarrow/table.pxi":1612
 *         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":1613
 * 
 *         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(10, 1613, __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(10, 1613, __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":1614
 *         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(10, 1614, __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(10, 1614, __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":1613
 * 
 *         table = self
 *         for idx in indices:             # <<<<<<<<<<<<<<
 *             table = table.remove_column(idx)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1616
 *             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":1594
 *         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":1619
 * 
 * 
 * def _reconstruct_table(arrays, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct pa.Table from pickled components.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_101_reconstruct_table(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_100_reconstruct_table[] = "_reconstruct_table(arrays, schema)\n\n    Internal: reconstruct pa.Table from pickled components.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_101_reconstruct_table = {"_reconstruct_table", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_101_reconstruct_table, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_100_reconstruct_table};
static PyObject *__pyx_pw_7pyarrow_3lib_101_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(10, 1619, __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(10, 1619, __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(10, 1619, __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_100_reconstruct_table(__pyx_self, __pyx_v_arrays, __pyx_v_schema);

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

static PyObject *__pyx_pf_7pyarrow_3lib_100_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":1623
 *     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(10, 1623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 1623, __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(10, 1623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_schema, __pyx_v_schema) < 0) __PYX_ERR(10, 1623, __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(10, 1623, __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":1619
 * 
 * 
 * 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":1626
 * 
 * 
 * def concat_tables(tables):             # <<<<<<<<<<<<<<
 *     """
 *     Perform zero-copy concatenation of pyarrow.Table objects. Raises exception
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_103concat_tables(PyObject *__pyx_self, PyObject *__pyx_v_tables); /*proto*/
static char __pyx_doc_7pyarrow_3lib_102concat_tables[] = "concat_tables(tables)\n\n    Perform zero-copy concatenation of pyarrow.Table objects. Raises exception\n    if all of the Table schemas are not the same\n\n    Parameters\n    ----------\n    tables : iterable of pyarrow.Table objects\n    output_name : string, default None\n      A name for the output table, if any\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_103concat_tables = {"concat_tables", (PyCFunction)__pyx_pw_7pyarrow_3lib_103concat_tables, METH_O, __pyx_doc_7pyarrow_3lib_102concat_tables};
static PyObject *__pyx_pw_7pyarrow_3lib_103concat_tables(PyObject *__pyx_self, PyObject *__pyx_v_tables) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("concat_tables (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_102concat_tables(__pyx_self, ((PyObject *)__pyx_v_tables));

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

static PyObject *__pyx_pf_7pyarrow_3lib_102concat_tables(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_tables) {
  std::vector<std::shared_ptr< arrow::Table> >  __pyx_v_c_tables;
  std::shared_ptr< arrow::Table>  __pyx_v_c_result;
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table = 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;
  __Pyx_RefNannySetupContext("concat_tables", 0);

  /* "pyarrow/table.pxi":1642
 *         Table table
 * 
 *     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(10, 1642, __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, 1642, __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, 1642, __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, 1642, __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, 1642, __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, 1642, __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, 1642, __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(10, 1642, __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":1643
 * 
 *     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(10, 1643, __pyx_L1_error)
    }

    /* "pyarrow/table.pxi":1642
 *         Table table
 * 
 *     for table in tables:             # <<<<<<<<<<<<<<
 *         c_tables.push_back(table.sp_table)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/table.pxi":1645
 *         c_tables.push_back(table.sp_table)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ConcatenateTables(c_tables, &c_result))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/table.pxi":1646
 * 
 *     with nogil:
 *         check_status(ConcatenateTables(c_tables, &c_result))             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_table(c_result)
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(arrow::ConcatenateTables(__pyx_v_c_tables, (&__pyx_v_c_result))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(10, 1646, __pyx_L6_error)
      }

      /* "pyarrow/table.pxi":1645
 *         c_tables.push_back(table.sp_table)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ConcatenateTables(c_tables, &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/table.pxi":1648
 *         check_status(ConcatenateTables(c_tables, &c_result))
 * 
 *     return pyarrow_wrap_table(c_result)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_c_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 1648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/table.pxi":1626
 * 
 * 
 * def concat_tables(tables):             # <<<<<<<<<<<<<<
 *     """
 *     Perform zero-copy concatenation of pyarrow.Table objects. Raises exception
 */

  /* 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/io.pxi":47
 * cdef class NativeFile:
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.closed = True
 *         self.own_file = 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":48
 * 
 *     def __cinit__(self):
 *         self.closed = True             # <<<<<<<<<<<<<<
 *         self.own_file = False
 *         self.is_readable = False
 */
  __pyx_v_self->closed = 1;

  /* "pyarrow/io.pxi":49
 *     def __cinit__(self):
 *         self.closed = True
 *         self.own_file = False             # <<<<<<<<<<<<<<
 *         self.is_readable = False
 *         self.is_writable = False
 */
  __pyx_v_self->own_file = 0;

  /* "pyarrow/io.pxi":50
 *         self.closed = True
 *         self.own_file = False
 *         self.is_readable = False             # <<<<<<<<<<<<<<
 *         self.is_writable = False
 * 
 */
  __pyx_v_self->is_readable = 0;

  /* "pyarrow/io.pxi":51
 *         self.own_file = False
 *         self.is_readable = False
 *         self.is_writable = False             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->is_writable = 0;

  /* "pyarrow/io.pxi":47
 * cdef class NativeFile:
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.closed = True
 *         self.own_file = False
 */

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

/* "pyarrow/io.pxi":53
 *         self.is_writable = False
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.own_file and not self.closed:
 *             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;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyarrow/io.pxi":54
 * 
 *     def __dealloc__(self):
 *         if self.own_file and not self.closed:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  __pyx_t_2 = (__pyx_v_self->own_file != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((!(__pyx_v_self->closed != 0)) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":55
 *     def __dealloc__(self):
 *         if self.own_file and not self.closed:
 *             self.close()             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_close); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 55, __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(4, 55, __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/io.pxi":54
 * 
 *     def __dealloc__(self):
 *         if self.own_file and not self.closed:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  }

  /* "pyarrow/io.pxi":53
 *         self.is_writable = False
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.own_file and not self.closed:
 *             self.close()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("pyarrow.lib.NativeFile.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyarrow/io.pxi":57
 *             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":58
 * 
 *     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":57
 *             self.close()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

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

/* "pyarrow/io.pxi":60
 *         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(4, 60, __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(4, 60, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(4, 60, __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(4, 60, __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":61
 * 
 *     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(4, 61, __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, 61, __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":60
 *         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":64
 * 
 *     @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":73
 *         """
 *         # 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":74
 *         # 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_s_rb);
    __pyx_r = __pyx_kp_s_rb;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":73
 *         """
 *         # Emulate built-in file modes
 *         if self.is_readable and self.is_writable:             # <<<<<<<<<<<<<<
 *             return 'rb+'
 *         elif self.is_readable:
 */
  }

  /* "pyarrow/io.pxi":75
 *         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":76
 *             return 'rb+'
 *         elif self.is_readable:
 *             return 'rb'             # <<<<<<<<<<<<<<
 *         elif self.is_writable:
 *             return 'wb'
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_s_rb_2);
    __pyx_r = __pyx_n_s_rb_2;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":75
 *         if self.is_readable and self.is_writable:
 *             return 'rb+'
 *         elif self.is_readable:             # <<<<<<<<<<<<<<
 *             return 'rb'
 *         elif self.is_writable:
 */
  }

  /* "pyarrow/io.pxi":77
 *         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":78
 *             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_s_wb);
    __pyx_r = __pyx_n_s_wb;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":77
 *         elif self.is_readable:
 *             return 'rb'
 *         elif self.is_writable:             # <<<<<<<<<<<<<<
 *             return 'wb'
 *         else:
 */
  }

  /* "pyarrow/io.pxi":80
 *             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__112, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 80, __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, 80, __pyx_L1_error)
  }

  /* "pyarrow/io.pxi":64
 * 
 *     @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":82
 *             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":83
 * 
 *     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(4, 83, __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, 83, __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":84
 *     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(4, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":82
 *             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":86
 *         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":87
 * 
 *     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(4, 87, __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, 87, __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":88
 *     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(4, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":86
 *         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":90
 *         return self.is_writable
 * 
 *     def seekable(self):             # <<<<<<<<<<<<<<
 *         self._assert_open()
 *         return self.is_readable
 */

/* 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":91
 * 
 *     def seekable(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(4, 91, __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, 91, __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":92
 *     def seekable(self):
 *         self._assert_open()
 *         return self.is_readable             # <<<<<<<<<<<<<<
 * 
 *     def isatty(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->is_readable); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":90
 *         return self.is_writable
 * 
 *     def seekable(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.seekable", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":94
 *         return self.is_readable
 * 
 *     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":95
 * 
 *     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(4, 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(4, 95, __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":96
 *     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":94
 *         return self.is_readable
 * 
 *     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":98
 *         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":102
 *         NOT IMPLEMENTED
 *         """
 *         raise UnsupportedOperation()             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 102, __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, 102, __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, 102, __pyx_L1_error)

  /* "pyarrow/io.pxi":98
 *         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":104
 *         raise UnsupportedOperation()
 * 
 *     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
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("close", 0);

  /* "pyarrow/io.pxi":105
 * 
 *     def close(self):
 *         if not self.closed:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 if self.is_readable:
 */
  __pyx_t_1 = ((!(__pyx_v_self->closed != 0)) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":106
 *     def close(self):
 *         if not self.closed:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 if self.is_readable:
 *                     check_status(self.rd_file.get().Close())
 */
    {
        #ifdef WITH_THREAD
        PyThreadState *_save;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        #endif
        /*try:*/ {

          /* "pyarrow/io.pxi":107
 *         if not self.closed:
 *             with nogil:
 *                 if self.is_readable:             # <<<<<<<<<<<<<<
 *                     check_status(self.rd_file.get().Close())
 *                 else:
 */
          __pyx_t_1 = (__pyx_v_self->is_readable != 0);
          if (__pyx_t_1) {

            /* "pyarrow/io.pxi":108
 *             with nogil:
 *                 if self.is_readable:
 *                     check_status(self.rd_file.get().Close())             # <<<<<<<<<<<<<<
 *                 else:
 *                     check_status(self.wr_file.get().Close())
 */
            __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->rd_file.get()->Close()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 108, __pyx_L5_error)

            /* "pyarrow/io.pxi":107
 *         if not self.closed:
 *             with nogil:
 *                 if self.is_readable:             # <<<<<<<<<<<<<<
 *                     check_status(self.rd_file.get().Close())
 *                 else:
 */
            goto __pyx_L7;
          }

          /* "pyarrow/io.pxi":110
 *                     check_status(self.rd_file.get().Close())
 *                 else:
 *                     check_status(self.wr_file.get().Close())             # <<<<<<<<<<<<<<
 *         self.closed = True
 * 
 */
          /*else*/ {
            __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->wr_file.get()->Close()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 110, __pyx_L5_error)
          }
          __pyx_L7:;
        }

        /* "pyarrow/io.pxi":106
 *     def close(self):
 *         if not self.closed:
 *             with nogil:             # <<<<<<<<<<<<<<
 *                 if self.is_readable:
 *                     check_status(self.rd_file.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":105
 * 
 *     def close(self):
 *         if not self.closed:             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 if self.is_readable:
 */
  }

  /* "pyarrow/io.pxi":111
 *                 else:
 *                     check_status(self.wr_file.get().Close())
 *         self.closed = True             # <<<<<<<<<<<<<<
 * 
 *     def flush(self):
 */
  __pyx_v_self->closed = 1;

  /* "pyarrow/io.pxi":104
 *         raise UnsupportedOperation()
 * 
 *     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_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":113
 *         self.closed = True
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         """Flush the buffer stream, if applicable.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_21flush(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_20flush[] = "NativeFile.flush(self)\nFlush the buffer stream, if applicable.\n\n        No-op to match the IOBase interface.";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_21flush(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_20flush(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_20flush(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("flush", 0);

  /* "pyarrow/io.pxi":117
 * 
 *         No-op to match the IOBase interface."""
 *         self._assert_open()             # <<<<<<<<<<<<<<
 * 
 *     cdef read_handle(self, shared_ptr[RandomAccessFile]* file):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 117, __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, 117, __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":113
 *         self.closed = True
 * 
 *     def flush(self):             # <<<<<<<<<<<<<<
 *         """Flush the buffer 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":119
 *         self._assert_open()
 * 
 *     cdef read_handle(self, shared_ptr[RandomAccessFile]* file):             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         file[0] = <shared_ptr[RandomAccessFile]> self.rd_file
 */

static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_read_handle(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr<arrow::io::RandomAccessFile>  *__pyx_v_file) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("read_handle", 0);

  /* "pyarrow/io.pxi":120
 * 
 *     cdef read_handle(self, shared_ptr[RandomAccessFile]* file):
 *         self._assert_readable()             # <<<<<<<<<<<<<<
 *         file[0] = <shared_ptr[RandomAccessFile]> self.rd_file
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_readable); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 120, __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, 120, __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":121
 *     cdef read_handle(self, shared_ptr[RandomAccessFile]* file):
 *         self._assert_readable()
 *         file[0] = <shared_ptr[RandomAccessFile]> self.rd_file             # <<<<<<<<<<<<<<
 * 
 *     cdef write_handle(self, shared_ptr[OutputStream]* file):
 */
  (__pyx_v_file[0]) = ((std::shared_ptr<arrow::io::RandomAccessFile> )__pyx_v_self->rd_file);

  /* "pyarrow/io.pxi":119
 *         self._assert_open()
 * 
 *     cdef read_handle(self, shared_ptr[RandomAccessFile]* file):             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         file[0] = <shared_ptr[RandomAccessFile]> self.rd_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.read_handle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":123
 *         file[0] = <shared_ptr[RandomAccessFile]> self.rd_file
 * 
 *     cdef write_handle(self, shared_ptr[OutputStream]* file):             # <<<<<<<<<<<<<<
 *         self._assert_writable()
 *         file[0] = <shared_ptr[OutputStream]> self.wr_file
 */

static PyObject *__pyx_f_7pyarrow_3lib_10NativeFile_write_handle(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, std::shared_ptr<arrow::io::OutputStream>  *__pyx_v_file) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("write_handle", 0);

  /* "pyarrow/io.pxi":124
 * 
 *     cdef write_handle(self, shared_ptr[OutputStream]* file):
 *         self._assert_writable()             # <<<<<<<<<<<<<<
 *         file[0] = <shared_ptr[OutputStream]> self.wr_file
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_writable); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 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(4, 124, __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":125
 *     cdef write_handle(self, shared_ptr[OutputStream]* file):
 *         self._assert_writable()
 *         file[0] = <shared_ptr[OutputStream]> self.wr_file             # <<<<<<<<<<<<<<
 * 
 *     def _assert_open(self):
 */
  (__pyx_v_file[0]) = ((std::shared_ptr<arrow::io::OutputStream> )__pyx_v_self->wr_file);

  /* "pyarrow/io.pxi":123
 *         file[0] = <shared_ptr[RandomAccessFile]> self.rd_file
 * 
 *     cdef write_handle(self, shared_ptr[OutputStream]* file):             # <<<<<<<<<<<<<<
 *         self._assert_writable()
 *         file[0] = <shared_ptr[OutputStream]> self.wr_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.write_handle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":127
 *         file[0] = <shared_ptr[OutputStream]> self.wr_file
 * 
 *     def _assert_open(self):             # <<<<<<<<<<<<<<
 *         if self.closed:
 *             raise ValueError("I/O operation on closed file")
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_23_assert_open(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_22_assert_open[] = "NativeFile._assert_open(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_23_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_22_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_22_assert_open(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("_assert_open", 0);

  /* "pyarrow/io.pxi":128
 * 
 *     def _assert_open(self):
 *         if self.closed:             # <<<<<<<<<<<<<<
 *             raise ValueError("I/O operation on closed file")
 * 
 */
  __pyx_t_1 = (__pyx_v_self->closed != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":129
 *     def _assert_open(self):
 *         if self.closed:
 *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_readable(self):
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 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(4, 129, __pyx_L1_error)

    /* "pyarrow/io.pxi":128
 * 
 *     def _assert_open(self):
 *         if self.closed:             # <<<<<<<<<<<<<<
 *             raise ValueError("I/O operation on closed file")
 * 
 */
  }

  /* "pyarrow/io.pxi":127
 *         file[0] = <shared_ptr[OutputStream]> self.wr_file
 * 
 *     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_2);
  __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":131
 *             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_25_assert_readable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_24_assert_readable[] = "NativeFile._assert_readable(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_25_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_24_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_24_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":132
 * 
 *     def _assert_readable(self):
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         if not self.is_readable:
 *             raise IOError("only valid on readonly files")
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 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(4, 132, __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":133
 *     def _assert_readable(self):
 *         self._assert_open()
 *         if not self.is_readable:             # <<<<<<<<<<<<<<
 *             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":134
 *         self._assert_open()
 *         if not self.is_readable:
 *             raise IOError("only valid on readonly files")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_writable(self):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 134, __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, 134, __pyx_L1_error)

    /* "pyarrow/io.pxi":133
 *     def _assert_readable(self):
 *         self._assert_open()
 *         if not self.is_readable:             # <<<<<<<<<<<<<<
 *             raise IOError("only valid on readonly files")
 * 
 */
  }

  /* "pyarrow/io.pxi":131
 *             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":136
 *             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_27_assert_writable(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_26_assert_writable[] = "NativeFile._assert_writable(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_27_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_26_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_26_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":137
 * 
 *     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(4, 137, __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, 137, __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":138
 *     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":139
 *         self._assert_open()
 *         if not self.is_writable:
 *             raise IOError("only valid on writable files")             # <<<<<<<<<<<<<<
 * 
 *     def size(self):
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 139, __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, 139, __pyx_L1_error)

    /* "pyarrow/io.pxi":138
 *     def _assert_writable(self):
 *         self._assert_open()
 *         if not self.is_writable:             # <<<<<<<<<<<<<<
 *             raise IOError("only valid on writable files")
 * 
 */
  }

  /* "pyarrow/io.pxi":136
 *             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":141
 *             raise IOError("only valid on writable 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;
  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("size", 0);

  /* "pyarrow/io.pxi":146
 *         """
 *         cdef int64_t size
 *         self._assert_readable()             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.rd_file.get().GetSize(&size))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_readable); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 146, __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, 146, __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":147
 *         cdef int64_t size
 *         self._assert_readable()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.rd_file.get().GetSize(&size))
 *         return size
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":148
 *         self._assert_readable()
 *         with nogil:
 *             check_status(self.rd_file.get().GetSize(&size))             # <<<<<<<<<<<<<<
 *         return size
 * 
 */
        __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->rd_file.get()->GetSize((&__pyx_v_size))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 148, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":147
 *         cdef int64_t size
 *         self._assert_readable()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.rd_file.get().GetSize(&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/io.pxi":149
 *         with nogil:
 *             check_status(self.rd_file.get().GetSize(&size))
 *         return size             # <<<<<<<<<<<<<<
 * 
 *     def tell(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":141
 *             raise IOError("only valid on writable files")
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return file 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.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":151
 *         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;
  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("tell", 0);

  /* "pyarrow/io.pxi":156
 *         """
 *         cdef int64_t position
 *         self._assert_open()             # <<<<<<<<<<<<<<
 *         with nogil:
 *             if 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(4, 156, __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, 156, __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":157
 *         cdef int64_t position
 *         self._assert_open()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             if self.is_readable:
 *                 check_status(self.rd_file.get().Tell(&position))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":158
 *         self._assert_open()
 *         with nogil:
 *             if self.is_readable:             # <<<<<<<<<<<<<<
 *                 check_status(self.rd_file.get().Tell(&position))
 *             else:
 */
        __pyx_t_4 = (__pyx_v_self->is_readable != 0);
        if (__pyx_t_4) {

          /* "pyarrow/io.pxi":159
 *         with nogil:
 *             if self.is_readable:
 *                 check_status(self.rd_file.get().Tell(&position))             # <<<<<<<<<<<<<<
 *             else:
 *                 check_status(self.wr_file.get().Tell(&position))
 */
          __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->rd_file.get()->Tell((&__pyx_v_position))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 159, __pyx_L4_error)

          /* "pyarrow/io.pxi":158
 *         self._assert_open()
 *         with nogil:
 *             if self.is_readable:             # <<<<<<<<<<<<<<
 *                 check_status(self.rd_file.get().Tell(&position))
 *             else:
 */
          goto __pyx_L6;
        }

        /* "pyarrow/io.pxi":161
 *                 check_status(self.rd_file.get().Tell(&position))
 *             else:
 *                 check_status(self.wr_file.get().Tell(&position))             # <<<<<<<<<<<<<<
 *         return position
 * 
 */
        /*else*/ {
          __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->wr_file.get()->Tell((&__pyx_v_position))); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 161, __pyx_L4_error)
        }
        __pyx_L6:;
      }

      /* "pyarrow/io.pxi":157
 *         cdef int64_t position
 *         self._assert_open()
 *         with nogil:             # <<<<<<<<<<<<<<
 *             if self.is_readable:
 *                 check_status(self.rd_file.get().Tell(&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":162
 *             else:
 *                 check_status(self.wr_file.get().Tell(&position))
 *         return position             # <<<<<<<<<<<<<<
 * 
 *     def seek(self, int64_t position, int whence=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":151
 *         return size
 * 
 *     def tell(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return current stream position
 */

  /* 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.tell", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":164
 *         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(4, 164, __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(4, 164, __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(4, 164, __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(4, 164, __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;
  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("seek", 0);

  /* "pyarrow/io.pxi":187
 *         """
 *         cdef int64_t offset
 *         self._assert_readable()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_readable); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 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_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, 187, __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":189
 *         self._assert_readable()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             if whence == 0:
 *                 offset = position
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":190
 * 
 *         with nogil:
 *             if whence == 0:             # <<<<<<<<<<<<<<
 *                 offset = position
 *             elif whence == 1:
 */
        switch (__pyx_v_whence) {
          case 0:

          /* "pyarrow/io.pxi":191
 *         with nogil:
 *             if whence == 0:
 *                 offset = position             # <<<<<<<<<<<<<<
 *             elif whence == 1:
 *                 check_status(self.rd_file.get().Tell(&offset))
 */
          __pyx_v_offset = __pyx_v_position;

          /* "pyarrow/io.pxi":190
 * 
 *         with nogil:
 *             if whence == 0:             # <<<<<<<<<<<<<<
 *                 offset = position
 *             elif whence == 1:
 */
          break;
          case 1:

          /* "pyarrow/io.pxi":193
 *                 offset = position
 *             elif whence == 1:
 *                 check_status(self.rd_file.get().Tell(&offset))             # <<<<<<<<<<<<<<
 *                 offset = offset + position
 *             elif whence == 2:
 */
          __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->rd_file.get()->Tell((&__pyx_v_offset))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 193, __pyx_L4_error)

          /* "pyarrow/io.pxi":194
 *             elif whence == 1:
 *                 check_status(self.rd_file.get().Tell(&offset))
 *                 offset = offset + position             # <<<<<<<<<<<<<<
 *             elif whence == 2:
 *                 check_status(self.rd_file.get().GetSize(&offset))
 */
          __pyx_v_offset = (__pyx_v_offset + __pyx_v_position);

          /* "pyarrow/io.pxi":192
 *             if whence == 0:
 *                 offset = position
 *             elif whence == 1:             # <<<<<<<<<<<<<<
 *                 check_status(self.rd_file.get().Tell(&offset))
 *                 offset = offset + position
 */
          break;
          case 2:

          /* "pyarrow/io.pxi":196
 *                 offset = offset + position
 *             elif whence == 2:
 *                 check_status(self.rd_file.get().GetSize(&offset))             # <<<<<<<<<<<<<<
 *                 offset = offset + position
 *             else:
 */
          __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->rd_file.get()->GetSize((&__pyx_v_offset))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 196, __pyx_L4_error)

          /* "pyarrow/io.pxi":197
 *             elif whence == 2:
 *                 check_status(self.rd_file.get().GetSize(&offset))
 *                 offset = offset + position             # <<<<<<<<<<<<<<
 *             else:
 *                 with gil:
 */
          __pyx_v_offset = (__pyx_v_offset + __pyx_v_position);

          /* "pyarrow/io.pxi":195
 *                 check_status(self.rd_file.get().Tell(&offset))
 *                 offset = offset + position
 *             elif whence == 2:             # <<<<<<<<<<<<<<
 *                 check_status(self.rd_file.get().GetSize(&offset))
 *                 offset = offset + position
 */
          break;
          default:

          /* "pyarrow/io.pxi":199
 *                 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":201
 *                 with gil:
 *                     raise ValueError("Invalid value of whence: {0}"
 *                                      .format(whence))             # <<<<<<<<<<<<<<
 *             check_status(self.rd_file.get().Seek(offset))
 * 
 */
                __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Invalid_value_of_whence_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 201, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_2);
                __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_whence); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 201, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_3);
                __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_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
                __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 201, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

                /* "pyarrow/io.pxi":200
 *             else:
 *                 with gil:
 *                     raise ValueError("Invalid value of whence: {0}"             # <<<<<<<<<<<<<<
 *                                      .format(whence))
 *             check_status(self.rd_file.get().Seek(offset))
 */
                __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 200, __pyx_L7_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, 200, __pyx_L7_error)
              }

              /* "pyarrow/io.pxi":199
 *                 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":202
 *                     raise ValueError("Invalid value of whence: {0}"
 *                                      .format(whence))
 *             check_status(self.rd_file.get().Seek(offset))             # <<<<<<<<<<<<<<
 * 
 *         return self.tell()
 */
        __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->rd_file.get()->Seek(__pyx_v_offset)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 202, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":189
 *         self._assert_readable()
 * 
 *         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":204
 *             check_status(self.rd_file.get().Seek(offset))
 * 
 *         return self.tell()             # <<<<<<<<<<<<<<
 * 
 *     def write(self, data):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tell); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 204, __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(4, 204, __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/io.pxi":164
 *         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_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __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":206
 *         return self.tell()
 * 
 *     def write(self, data):             # <<<<<<<<<<<<<<
 *         """
 *         Write byte from any object implementing buffer protocol (bytes,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_35write(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_34write[] = "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_35write(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_34write(((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_34write(struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_self, PyObject *__pyx_v_data) {
  struct __pyx_obj_7pyarrow_3lib_Buffer *__pyx_v_arrow_buffer = 0;
  uint8_t const *__pyx_v_buf;
  int64_t __pyx_v_bufsize;
  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;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("write", 0);

  /* "pyarrow/io.pxi":219
 *         nbytes : number of bytes written
 *         """
 *         self._assert_writable()             # <<<<<<<<<<<<<<
 * 
 *         cdef Buffer arrow_buffer = py_buffer(data)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_writable); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 219, __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, 219, __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":221
 *         self._assert_writable()
 * 
 *         cdef Buffer arrow_buffer = py_buffer(data)             # <<<<<<<<<<<<<<
 * 
 *         cdef const uint8_t* buf = arrow_buffer.buffer.get().data()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 221, __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_data) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_data);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 221, __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(4, 221, __pyx_L1_error)
  __pyx_v_arrow_buffer = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":223
 *         cdef Buffer arrow_buffer = py_buffer(data)
 * 
 *         cdef const uint8_t* buf = arrow_buffer.buffer.get().data()             # <<<<<<<<<<<<<<
 *         cdef int64_t bufsize = len(arrow_buffer)
 *         with nogil:
 */
  __pyx_v_buf = __pyx_v_arrow_buffer->buffer.get()->data();

  /* "pyarrow/io.pxi":224
 * 
 *         cdef const uint8_t* buf = arrow_buffer.buffer.get().data()
 *         cdef int64_t bufsize = len(arrow_buffer)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.wr_file.get().Write(buf, bufsize))
 */
  __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_arrow_buffer)); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(4, 224, __pyx_L1_error)
  __pyx_v_bufsize = __pyx_t_4;

  /* "pyarrow/io.pxi":225
 *         cdef const uint8_t* buf = arrow_buffer.buffer.get().data()
 *         cdef int64_t bufsize = len(arrow_buffer)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.wr_file.get().Write(buf, bufsize))
 *         return bufsize
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":226
 *         cdef int64_t bufsize = len(arrow_buffer)
 *         with nogil:
 *             check_status(self.wr_file.get().Write(buf, bufsize))             # <<<<<<<<<<<<<<
 *         return bufsize
 * 
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->wr_file.get()->Write(__pyx_v_buf, __pyx_v_bufsize)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 226, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":225
 *         cdef const uint8_t* buf = arrow_buffer.buffer.get().data()
 *         cdef int64_t bufsize = len(arrow_buffer)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.wr_file.get().Write(buf, bufsize))
 *         return bufsize
 */
      /*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":227
 *         with nogil:
 *             check_status(self.wr_file.get().Write(buf, bufsize))
 *         return bufsize             # <<<<<<<<<<<<<<
 * 
 *     def read(self, nbytes=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_bufsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":206
 *         return self.tell()
 * 
 *     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_XDECREF((PyObject *)__pyx_v_arrow_buffer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":229
 *         return bufsize
 * 
 *     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_37read(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_36read[] = "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_37read(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(4, 229, __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(4, 229, __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_36read(((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_36read(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;
  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;
  int64_t __pyx_t_7;
  PyObject *__pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("read", 0);

  /* "pyarrow/io.pxi":244
 *         cdef:
 *             int64_t c_nbytes
 *             int64_t bytes_read = 0             # <<<<<<<<<<<<<<
 *             PyObject* obj
 * 
 */
  __pyx_v_bytes_read = 0;

  /* "pyarrow/io.pxi":247
 *             PyObject* obj
 * 
 *         if nbytes is None:             # <<<<<<<<<<<<<<
 *             c_nbytes = self.size() - self.tell()
 *         else:
 */
  __pyx_t_1 = (__pyx_v_nbytes == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":248
 * 
 *         if nbytes is None:
 *             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(4, 248, __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(4, 248, __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(4, 248, __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(4, 248, __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(4, 248, __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_7 = __Pyx_PyInt_As_int64_t(__pyx_t_5); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 248, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_c_nbytes = __pyx_t_7;

    /* "pyarrow/io.pxi":247
 *             PyObject* obj
 * 
 *         if nbytes is None:             # <<<<<<<<<<<<<<
 *             c_nbytes = self.size() - self.tell()
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":250
 *             c_nbytes = self.size() - self.tell()
 *         else:
 *             c_nbytes = nbytes             # <<<<<<<<<<<<<<
 * 
 *         self._assert_readable()
 */
  /*else*/ {
    __pyx_t_7 = __Pyx_PyInt_As_int64_t(__pyx_v_nbytes); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 250, __pyx_L1_error)
    __pyx_v_c_nbytes = __pyx_t_7;
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":252
 *             c_nbytes = nbytes
 * 
 *         self._assert_readable()             # <<<<<<<<<<<<<<
 * 
 *         # Allocate empty write space
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_readable); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/io.pxi":255
 * 
 *         # Allocate empty write space
 *         obj = PyBytes_FromStringAndSizeNative(NULL, c_nbytes)             # <<<<<<<<<<<<<<
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 */
  __pyx_t_8 =  PyBytes_FromStringAndSize(NULL, __pyx_v_c_nbytes); if (unlikely(__pyx_t_8 == ((PyObject *)NULL))) __PYX_ERR(4, 255, __pyx_L1_error)
  __pyx_v_obj = __pyx_t_8;

  /* "pyarrow/io.pxi":257
 *         obj = PyBytes_FromStringAndSizeNative(NULL, c_nbytes)
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(self.rd_file.get().Read(c_nbytes, &bytes_read, buf))
 */
  __pyx_v_buf = ((uint8_t *)PyBytes_AS_STRING(((PyObject *)__pyx_v_obj)));

  /* "pyarrow/io.pxi":258
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.rd_file.get().Read(c_nbytes, &bytes_read, buf))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":259
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:
 *             check_status(self.rd_file.get().Read(c_nbytes, &bytes_read, buf))             # <<<<<<<<<<<<<<
 * 
 *         if bytes_read < c_nbytes:
 */
        __pyx_t_9 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->rd_file.get()->Read(__pyx_v_c_nbytes, (&__pyx_v_bytes_read), __pyx_v_buf)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(4, 259, __pyx_L5_error)
      }

      /* "pyarrow/io.pxi":258
 * 
 *         cdef uint8_t* buf = <uint8_t*> cp.PyBytes_AS_STRING(<object> obj)
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.rd_file.get().Read(c_nbytes, &bytes_read, buf))
 * 
 */
      /*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
 *             check_status(self.rd_file.get().Read(c_nbytes, &bytes_read, buf))
 * 
 *         if bytes_read < c_nbytes:             # <<<<<<<<<<<<<<
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)
 * 
 */
  __pyx_t_2 = ((__pyx_v_bytes_read < __pyx_v_c_nbytes) != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":262
 * 
 *         if bytes_read < c_nbytes:
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)             # <<<<<<<<<<<<<<
 * 
 *         return PyObject_to_object(obj)
 */
    __pyx_t_9 = _PyBytes_Resize((&__pyx_v_obj), ((Py_ssize_t)__pyx_v_bytes_read)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(4, 262, __pyx_L1_error)

    /* "pyarrow/io.pxi":261
 *             check_status(self.rd_file.get().Read(c_nbytes, &bytes_read, buf))
 * 
 *         if bytes_read < c_nbytes:             # <<<<<<<<<<<<<<
 *             cp._PyBytes_Resize(&obj, <Py_ssize_t> bytes_read)
 * 
 */
  }

  /* "pyarrow/io.pxi":264
 *             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_5 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_obj); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":229
 *         return bufsize
 * 
 *     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_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":266
 *         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_39read1(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_38read1[] = "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_39read1(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(4, 266, __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(4, 266, __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_38read1(((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_38read1(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":270
 * 
 *         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(4, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_nbytes, Py_None) < 0) __PYX_ERR(4, 270, __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(4, 270, __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":266
 *         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":272
 *         return self.read(nbytes=None)
 * 
 *     def readall(self):             # <<<<<<<<<<<<<<
 *         return self.read()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_41readall(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_40readall[] = "NativeFile.readall(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_41readall(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_40readall(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_40readall(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":273
 * 
 *     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(4, 273, __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, 273, __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":272
 *         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":275
 *         return self.read()
 * 
 *     def readinto(self, b):             # <<<<<<<<<<<<<<
 *         """
 *         Read into the supplied buffer
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_43readinto(PyObject *__pyx_v_self, PyObject *__pyx_v_b); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_42readinto[] = "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_43readinto(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_42readinto(((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_42readinto(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;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int64_t __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("readinto", 0);

  /* "pyarrow/io.pxi":294
 *             int64_t buf_len
 * 
 *         self._assert_readable()             # <<<<<<<<<<<<<<
 * 
 *         py_buf = py_buffer(b)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_readable); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 294, __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, 294, __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":296
 *         self._assert_readable()
 * 
 *         py_buf = py_buffer(b)             # <<<<<<<<<<<<<<
 *         buf_len = py_buf.size
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 296, __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_b) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_b);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 296, __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(4, 296, __pyx_L1_error)
  __pyx_v_py_buf = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":297
 * 
 *         py_buf = py_buffer(b)
 *         buf_len = py_buf.size             # <<<<<<<<<<<<<<
 * 
 *         buf = py_buf.buffer.get().mutable_data()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_py_buf), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_int64_t(__pyx_t_1); if (unlikely((__pyx_t_4 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_buf_len = __pyx_t_4;

  /* "pyarrow/io.pxi":299
 *         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":301
 *         buf = py_buf.buffer.get().mutable_data()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.rd_file.get().Read(buf_len, &bytes_read, buf))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":302
 * 
 *         with nogil:
 *             check_status(self.rd_file.get().Read(buf_len, &bytes_read, buf))             # <<<<<<<<<<<<<<
 * 
 *         return bytes_read
 */
        __pyx_t_5 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->rd_file.get()->Read(__pyx_v_buf_len, (&__pyx_v_bytes_read), __pyx_v_buf)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 302, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":301
 *         buf = py_buf.buffer.get().mutable_data()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.rd_file.get().Read(buf_len, &bytes_read, 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":304
 *             check_status(self.rd_file.get().Read(buf_len, &bytes_read, buf))
 * 
 *         return bytes_read             # <<<<<<<<<<<<<<
 * 
 *     def readline(self, size=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t(__pyx_v_bytes_read); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":275
 *         return self.read()
 * 
 *     def readinto(self, b):             # <<<<<<<<<<<<<<
 *         """
 *         Read into the supplied buffer
 */

  /* 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.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":306
 *         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_45readline(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_44readline[] = "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_45readline(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(4, 306, __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(4, 306, __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_44readline(((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_44readline(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":314
 *         """
 * 
 *         raise UnsupportedOperation()             # <<<<<<<<<<<<<<
 * 
 *     def readlines(self, hint=None):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 314, __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, 314, __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, 314, __pyx_L1_error)

  /* "pyarrow/io.pxi":306
 *         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":316
 *         raise UnsupportedOperation()
 * 
 *     def readlines(self, hint=None):             # <<<<<<<<<<<<<<
 *         """NOT IMPLEMENTED. Read lines of the file
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_47readlines(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_46readlines[] = "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_47readlines(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(4, 316, __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(4, 316, __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_46readlines(((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_46readlines(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":325
 *         """
 * 
 *         raise UnsupportedOperation()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 325, __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, 325, __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, 325, __pyx_L1_error)

  /* "pyarrow/io.pxi":316
 *         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":327
 *         raise UnsupportedOperation()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         self._assert_readable()
 *         return self
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_49__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_49__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_48__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_48__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":328
 * 
 *     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(4, 328, __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, 328, __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":329
 *     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":327
 *         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":331
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         line = self.readline()
 *         if not line:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_51__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_51__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_10NativeFile_50__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_50__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":332
 * 
 *     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(4, 332, __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, 332, __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":333
 *     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(4, 333, __pyx_L1_error)
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/io.pxi":334
 *         line = self.readline()
 *         if not line:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         return line
 * 
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(4, 334, __pyx_L1_error)

    /* "pyarrow/io.pxi":333
 *     def __next__(self):
 *         line = self.readline()
 *         if not line:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         return line
 */
  }

  /* "pyarrow/io.pxi":335
 *         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":331
 *         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":337
 *         return line
 * 
 *     def read_buffer(self, nbytes=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int64_t c_nbytes
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_53read_buffer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_52read_buffer[] = "NativeFile.read_buffer(self, nbytes=None)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_53read_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(4, 337, __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(4, 337, __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_52read_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_52read_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;
  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;
  int64_t __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("read_buffer", 0);

  /* "pyarrow/io.pxi":340
 *         cdef:
 *             int64_t c_nbytes
 *             int64_t bytes_read = 0             # <<<<<<<<<<<<<<
 *             shared_ptr[CBuffer] output
 *         self._assert_readable()
 */
  __pyx_v_bytes_read = 0;

  /* "pyarrow/io.pxi":342
 *             int64_t bytes_read = 0
 *             shared_ptr[CBuffer] output
 *         self._assert_readable()             # <<<<<<<<<<<<<<
 * 
 *         if nbytes is None:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_readable); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 342, __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, 342, __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":344
 *         self._assert_readable()
 * 
 *         if nbytes is None:             # <<<<<<<<<<<<<<
 *             c_nbytes = self.size() - self.tell()
 *         else:
 */
  __pyx_t_4 = (__pyx_v_nbytes == Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/io.pxi":345
 * 
 *         if nbytes is None:
 *             c_nbytes = self.size() - self.tell()             # <<<<<<<<<<<<<<
 *         else:
 *             c_nbytes = nbytes
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 345, __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, 345, __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_tell); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 345, __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_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_2)) __PYX_ERR(4, 345, __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(4, 345, __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_t_7 = __Pyx_PyInt_As_int64_t(__pyx_t_3); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 345, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_c_nbytes = __pyx_t_7;

    /* "pyarrow/io.pxi":344
 *         self._assert_readable()
 * 
 *         if nbytes is None:             # <<<<<<<<<<<<<<
 *             c_nbytes = self.size() - self.tell()
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":347
 *             c_nbytes = self.size() - self.tell()
 *         else:
 *             c_nbytes = nbytes             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  /*else*/ {
    __pyx_t_7 = __Pyx_PyInt_As_int64_t(__pyx_v_nbytes); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 347, __pyx_L1_error)
    __pyx_v_c_nbytes = __pyx_t_7;
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":349
 *             c_nbytes = nbytes
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.rd_file.get().ReadB(c_nbytes, &output))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":350
 * 
 *         with nogil:
 *             check_status(self.rd_file.get().ReadB(c_nbytes, &output))             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_buffer(output)
 */
        __pyx_t_8 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->rd_file.get()-> Read(__pyx_v_c_nbytes, (&__pyx_v_output))); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 350, __pyx_L5_error)
      }

      /* "pyarrow/io.pxi":349
 *             c_nbytes = nbytes
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.rd_file.get().ReadB(c_nbytes, &output))
 * 
 */
      /*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":352
 *             check_status(self.rd_file.get().ReadB(c_nbytes, &output))
 * 
 *         return pyarrow_wrap_buffer(output)             # <<<<<<<<<<<<<<
 * 
 *     def truncate(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_buffer(__pyx_v_output); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":337
 *         return line
 * 
 *     def read_buffer(self, nbytes=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int64_t c_nbytes
 */

  /* 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_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":354
 *         return pyarrow_wrap_buffer(output)
 * 
 *     def truncate(self):             # <<<<<<<<<<<<<<
 *         """
 *         NOT IMPLEMENTED
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_55truncate(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_54truncate[] = "NativeFile.truncate(self)\n\n        NOT IMPLEMENTED\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_55truncate(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_54truncate(((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_10NativeFile_54truncate(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":358
 *         NOT IMPLEMENTED
 *         """
 *         raise UnsupportedOperation()             # <<<<<<<<<<<<<<
 * 
 *     def writelines(self, lines):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 358, __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, 358, __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, 358, __pyx_L1_error)

  /* "pyarrow/io.pxi":354
 *         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":360
 *         raise UnsupportedOperation()
 * 
 *     def writelines(self, lines):             # <<<<<<<<<<<<<<
 *         self._assert_writable()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_57writelines(PyObject *__pyx_v_self, PyObject *__pyx_v_lines); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_56writelines[] = "NativeFile.writelines(self, lines)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_57writelines(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_56writelines(((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_56writelines(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":361
 * 
 *     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(4, 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_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, 361, __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":363
 *         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(4, 363, __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(4, 363, __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(4, 363, __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(4, 363, __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(4, 363, __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(4, 363, __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(4, 363, __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":364
 * 
 *         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(4, 364, __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(4, 364, __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":363
 *         self._assert_writable()
 * 
 *         for line in lines:             # <<<<<<<<<<<<<<
 *             self.write(line)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":360
 *         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":366
 *             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_59download(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_58download[] = "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_59download(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(4, 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_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(4, 366, __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_58download(((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":383
 *             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_8_download *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_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_8_download *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "pyarrow/io.pxi":384
 * 
 *             def cleanup():
 *                 stream.close()             # <<<<<<<<<<<<<<
 *         else:
 *             stream = stream_or_path
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_stream)) { __Pyx_RaiseClosureNameError("stream"); __PYX_ERR(4, 384, __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(4, 384, __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, 384, __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":383
 *             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":388
 *             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":394
 *         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_8_download *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_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;
  __Pyx_RefNannySetupContext("bg_write", 0);
  __pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_download *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "pyarrow/io.pxi":395
 * 
 *         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":396
 *         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(4, 396, __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(4, 396, __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(4, 396, __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(4, 396, __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(4, 396, __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":397
 *             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":398
 *                 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(4, 398, __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(4, 398, __pyx_L16_error)
              __Pyx_GOTREF(__pyx_t_7);
              __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 398, __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(4, 398, __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(4, 398, __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":397
 *             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_7); __pyx_t_7 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

            /* "pyarrow/io.pxi":399
 *                     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(4, 399, __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(4, 399, __pyx_L18_except_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_GOTREF(__pyx_t_6);
              __Pyx_GOTREF(__pyx_t_8);

              /* "pyarrow/io.pxi":400
 *                         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":397
 *             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":401
 *                     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(4, 401, __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(4, 401, __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(4, 401, __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":395
 * 
 *         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_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "pyarrow/io.pxi":402
 *                         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(4, 402, __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;

        /* "pyarrow/io.pxi":403
 *                     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(4, 403, __pyx_L8_except_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(4, 403, __pyx_L8_except_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(4, 403, __pyx_L8_except_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;
        __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":395
 * 
 *         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":405
 *                 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(4, 405, __pyx_L1_error) }
      __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_cur_scope->__pyx_v_cleanup); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 405, __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_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __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;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
      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_11);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_9);
      __pyx_t_13 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
      {
        if (unlikely(!__pyx_cur_scope->__pyx_v_cleanup)) { __Pyx_RaiseClosureNameError("cleanup"); __PYX_ERR(4, 405, __pyx_L29_error) }
        __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_cur_scope->__pyx_v_cleanup); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 405, __pyx_L29_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      }
      __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_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0;
      __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
      goto __pyx_L1_error;
      __pyx_L29_error:;
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_10, __pyx_t_9);
      }
      __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_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "pyarrow/io.pxi":394
 *         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":366
 *             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_58download(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_8_download *__pyx_cur_scope;
  int64_t __pyx_v_bytes_read;
  uint8_t *__pyx_v_buf;
  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
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  size_t __pyx_t_6;
  int32_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  char const *__pyx_t_10;
  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;
  __Pyx_RefNannySetupContext("download", 0);
  __pyx_cur_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_download *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_8_download(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_8_download, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_download *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(4, 366, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __Pyx_INCREF(__pyx_v_buffer_size);

  /* "pyarrow/io.pxi":372
 *         """
 *         cdef:
 *             int64_t bytes_read = 0             # <<<<<<<<<<<<<<
 *             uint8_t* buf
 *         self._assert_readable()
 */
  __pyx_v_bytes_read = 0;

  /* "pyarrow/io.pxi":374
 *             int64_t bytes_read = 0
 *             uint8_t* buf
 *         self._assert_readable()             # <<<<<<<<<<<<<<
 * 
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_assert_readable); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 374, __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, 374, __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":376
 *         self._assert_readable()
 * 
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE             # <<<<<<<<<<<<<<
 * 
 *         write_queue = Queue(50)
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_buffer_size); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 376, __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(4, 376, __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":378
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE
 * 
 *         write_queue = Queue(50)             # <<<<<<<<<<<<<<
 * 
 *         if not hasattr(stream_or_path, 'read'):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Queue); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 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_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(4, 378, __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":380
 *         write_queue = Queue(50)
 * 
 *         if not hasattr(stream_or_path, 'read'):             # <<<<<<<<<<<<<<
 *             stream = open(stream_or_path, 'wb')
 * 
 */
  __pyx_t_4 = __Pyx_HasAttr(__pyx_v_stream_or_path, __pyx_n_s_read); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 380, __pyx_L1_error)
  __pyx_t_5 = ((!(__pyx_t_4 != 0)) != 0);
  if (__pyx_t_5) {

    /* "pyarrow/io.pxi":381
 * 
 *         if not hasattr(stream_or_path, 'read'):
 *             stream = open(stream_or_path, 'wb')             # <<<<<<<<<<<<<<
 * 
 *             def cleanup():
 */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_stream_or_path);
    __Pyx_GIVEREF(__pyx_v_stream_or_path);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_stream_or_path);
    __Pyx_INCREF(__pyx_n_s_wb);
    __Pyx_GIVEREF(__pyx_n_s_wb);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_wb);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_stream = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/io.pxi":383
 *             stream = open(stream_or_path, 'wb')
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 stream.close()
 *         else:
 */
    __pyx_t_2 = __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__116)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_cleanup = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/io.pxi":380
 *         write_queue = Queue(50)
 * 
 *         if not hasattr(stream_or_path, 'read'):             # <<<<<<<<<<<<<<
 *             stream = open(stream_or_path, 'wb')
 * 
 */
    goto __pyx_L5;
  }

  /* "pyarrow/io.pxi":386
 *                 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":388
 *             stream = stream_or_path
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 pass
 * 
 */
    __pyx_t_2 = __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__117)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_v_cleanup = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L5:;

  /* "pyarrow/io.pxi":391
 *                 pass
 * 
 *         done = False             # <<<<<<<<<<<<<<
 *         exc_info = None
 * 
 */
  __pyx_cur_scope->__pyx_v_done = 0;

  /* "pyarrow/io.pxi":392
 * 
 *         done = False
 *         exc_info = None             # <<<<<<<<<<<<<<
 * 
 *         def bg_write():
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_exc_info = Py_None;

  /* "pyarrow/io.pxi":394
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */
  __pyx_t_2 = __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__119)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_bg_write = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/io.pxi":407
 *                 cleanup()
 * 
 *         self.seek(0)             # <<<<<<<<<<<<<<
 * 
 *         writer_thread = threading.Thread(target=bg_write)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 407, __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_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_int_0);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 407, __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/io.pxi":409
 *         self.seek(0)
 * 
 *         writer_thread = threading.Thread(target=bg_write)             # <<<<<<<<<<<<<<
 * 
 *         # This isn't ideal -- PyBytes_FromStringAndSize copies the data from
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Thread); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 409, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_target, __pyx_v_bg_write) < 0) __PYX_ERR(4, 409, __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(4, 409, __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_writer_thread = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "pyarrow/io.pxi":413
 *         # 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_6 = __Pyx_PyInt_As_size_t(__pyx_v_buffer_size); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 413, __pyx_L1_error)
  __pyx_v_buf = ((uint8_t *)malloc(__pyx_t_6));

  /* "pyarrow/io.pxi":414
 *         # 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_5 = ((__pyx_v_buf == NULL) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "pyarrow/io.pxi":416
 *         if buf == NULL:
 *             raise MemoryError("Failed to allocate {0} bytes"
 *                               .format(buffer_size))             # <<<<<<<<<<<<<<
 * 
 *         writer_thread.start()
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Failed_to_allocate_0_bytes, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 416, __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_buffer_size) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_buffer_size);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 416, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyarrow/io.pxi":415
 *         buf = <uint8_t*> malloc(buffer_size)
 *         if buf == NULL:
 *             raise MemoryError("Failed to allocate {0} bytes"             # <<<<<<<<<<<<<<
 *                               .format(buffer_size))
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_MemoryError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 415, __pyx_L1_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(4, 415, __pyx_L1_error)

    /* "pyarrow/io.pxi":414
 *         # 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":418
 *                               .format(buffer_size))
 * 
 *         writer_thread.start()             # <<<<<<<<<<<<<<
 * 
 *         cdef int64_t total_bytes = 0
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 418, __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_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, 418, __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":420
 *         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":421
 * 
 *         cdef int64_t total_bytes = 0
 *         cdef int32_t c_buffer_size = buffer_size             # <<<<<<<<<<<<<<
 * 
 *         try:
 */
  __pyx_t_7 = __Pyx_PyInt_As_int32_t(__pyx_v_buffer_size); if (unlikely((__pyx_t_7 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 421, __pyx_L1_error)
  __pyx_v_c_buffer_size = __pyx_t_7;

  /* "pyarrow/io.pxi":423
 *         cdef int32_t c_buffer_size = buffer_size
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             while True:
 *                 with nogil:
 */
  /*try:*/ {

    /* "pyarrow/io.pxi":424
 * 
 *         try:
 *             while True:             # <<<<<<<<<<<<<<
 *                 with nogil:
 *                     check_status(self.rd_file.get()
 */
    while (1) {

      /* "pyarrow/io.pxi":425
 *         try:
 *             while True:
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     check_status(self.rd_file.get()
 *                                  .Read(c_buffer_size, &bytes_read, buf))
 */
      {
          #ifdef WITH_THREAD
          PyThreadState *_save;
          Py_UNBLOCK_THREADS
          __Pyx_FastGIL_Remember();
          #endif
          /*try:*/ {

            /* "pyarrow/io.pxi":426
 *             while True:
 *                 with nogil:
 *                     check_status(self.rd_file.get()             # <<<<<<<<<<<<<<
 *                                  .Read(c_buffer_size, &bytes_read, buf))
 * 
 */
            __pyx_t_8 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->rd_file.get()->Read(__pyx_v_c_buffer_size, (&__pyx_v_bytes_read), __pyx_v_buf)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 426, __pyx_L15_error)
          }

          /* "pyarrow/io.pxi":425
 *         try:
 *             while True:
 *                 with nogil:             # <<<<<<<<<<<<<<
 *                     check_status(self.rd_file.get()
 *                                  .Read(c_buffer_size, &bytes_read, 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":429
 *                                  .Read(c_buffer_size, &bytes_read, buf))
 * 
 *                 total_bytes += bytes_read             # <<<<<<<<<<<<<<
 * 
 *                 # EOF
 */
      __pyx_v_total_bytes = (__pyx_v_total_bytes + __pyx_v_bytes_read);

      /* "pyarrow/io.pxi":432
 * 
 *                 # EOF
 *                 if bytes_read == 0:             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      __pyx_t_5 = ((__pyx_v_bytes_read == 0) != 0);
      if (__pyx_t_5) {

        /* "pyarrow/io.pxi":433
 *                 # EOF
 *                 if bytes_read == 0:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 pybuf = cp.PyBytes_FromStringAndSize(<const char*>buf,
 */
        goto __pyx_L11_break;

        /* "pyarrow/io.pxi":432
 * 
 *                 # EOF
 *                 if bytes_read == 0:             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      }

      /* "pyarrow/io.pxi":435
 *                     break
 * 
 *                 pybuf = cp.PyBytes_FromStringAndSize(<const char*>buf,             # <<<<<<<<<<<<<<
 *                                                      bytes_read)
 * 
 */
      __pyx_t_2 = PyBytes_FromStringAndSize(((char const *)__pyx_v_buf), __pyx_v_bytes_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 435, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XDECREF_SET(__pyx_v_pybuf, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "pyarrow/io.pxi":438
 *                                                      bytes_read)
 * 
 *                 if writer_thread.is_alive():             # <<<<<<<<<<<<<<
 *                     while write_queue.full():
 *                         time.sleep(0.01)
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_is_alive); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 438, __pyx_L8_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_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, 438, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 438, __pyx_L8_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (__pyx_t_5) {

        /* "pyarrow/io.pxi":439
 * 
 *                 if writer_thread.is_alive():
 *                     while write_queue.full():             # <<<<<<<<<<<<<<
 *                         time.sleep(0.01)
 *                 else:
 */
        while (1) {
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_full); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 439, __pyx_L8_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_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, 439, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 439, __pyx_L8_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (!__pyx_t_5) break;

          /* "pyarrow/io.pxi":440
 *                 if writer_thread.is_alive():
 *                     while write_queue.full():
 *                         time.sleep(0.01)             # <<<<<<<<<<<<<<
 *                 else:
 *                     break
 */
          __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 440, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sleep); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 440, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = NULL;
          if (CYTHON_UNPACK_METHODS && unlikely(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_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_float_0_01) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_float_0_01);
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 440, __pyx_L8_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/io.pxi":438
 *                                                      bytes_read)
 * 
 *                 if writer_thread.is_alive():             # <<<<<<<<<<<<<<
 *                     while write_queue.full():
 *                         time.sleep(0.01)
 */
        goto __pyx_L18;
      }

      /* "pyarrow/io.pxi":442
 *                         time.sleep(0.01)
 *                 else:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 write_queue.put_nowait(pybuf)
 */
      /*else*/ {
        goto __pyx_L11_break;
      }
      __pyx_L18:;

      /* "pyarrow/io.pxi":444
 *                     break
 * 
 *                 write_queue.put_nowait(pybuf)             # <<<<<<<<<<<<<<
 *         finally:
 *             free(buf)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_write_queue, __pyx_n_s_put_nowait); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 444, __pyx_L8_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_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_pybuf) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_pybuf);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 444, __pyx_L8_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_L11_break:;
  }

  /* "pyarrow/io.pxi":446
 *                 write_queue.put_nowait(pybuf)
 *         finally:
 *             free(buf)             # <<<<<<<<<<<<<<
 *             done = True
 * 
 */
  /*finally:*/ {
    /*normal exit:*/{
      free(__pyx_v_buf);

      /* "pyarrow/io.pxi":447
 *         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_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
      {

        /* "pyarrow/io.pxi":446
 *                 write_queue.put_nowait(pybuf)
 *         finally:
 *             free(buf)             # <<<<<<<<<<<<<<
 *             done = True
 * 
 */
        free(__pyx_v_buf);

        /* "pyarrow/io.pxi":447
 *         finally:
 *             free(buf)
 *             done = True             # <<<<<<<<<<<<<<
 * 
 *         writer_thread.join()
 */
        __pyx_cur_scope->__pyx_v_done = 1;
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
      }
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_XGIVEREF(__pyx_t_13);
      __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
      __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
      __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
      goto __pyx_L1_error;
    }
    __pyx_L9:;
  }

  /* "pyarrow/io.pxi":449
 *             done = True
 * 
 *         writer_thread.join()             # <<<<<<<<<<<<<<
 *         if exc_info is not None:
 *             raise exc_info[0], exc_info[1], exc_info[2]
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_writer_thread, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 449, __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(4, 449, __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/io.pxi":450
 * 
 *         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":451
 *         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_2 = __Pyx_GetItemInt(__pyx_v_exc_info, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_exc_info, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_exc_info, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_2, __pyx_t_1, __pyx_t_3, 0);
    __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;
    __PYX_ERR(4, 451, __pyx_L1_error)

    /* "pyarrow/io.pxi":450
 * 
 *         writer_thread.join()
 *         if exc_info is not None:             # <<<<<<<<<<<<<<
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 */
  }

  /* "pyarrow/io.pxi":366
 *             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_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __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":453
 *             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_61upload(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_60upload[] = "NativeFile.upload(self, stream, buffer_size=None)\n\n        Pipe file-like object to file\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_61upload(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(4, 453, __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(4, 453, __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_60upload(((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":465
 *         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_9_upload *__pyx_cur_scope;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_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;
  __Pyx_RefNannySetupContext("bg_write", 0);
  __pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_upload *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "pyarrow/io.pxi":466
 * 
 *         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":467
 *         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(4, 467, __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(4, 467, __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(4, 467, __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(4, 467, __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(4, 467, __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":468
 *             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":469
 *                 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(4, 469, __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(4, 469, __pyx_L13_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 469, __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(4, 469, __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(4, 469, __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":468
 *             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_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

          /* "pyarrow/io.pxi":470
 *                     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(4, 470, __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(4, 470, __pyx_L15_except_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_GOTREF(__pyx_t_8);

            /* "pyarrow/io.pxi":471
 *                         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":468
 *             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":473
 *                         continue
 * 
 *                     self.write(buf)             # <<<<<<<<<<<<<<
 * 
 *             except Exception as e:
 */
        if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(4, 473, __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(4, 473, __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(4, 473, __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":466
 * 
 *         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_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "pyarrow/io.pxi":475
 *                     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(4, 475, __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;

      /* "pyarrow/io.pxi":476
 * 
 *             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(4, 476, __pyx_L5_except_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(4, 476, __pyx_L5_except_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(4, 476, __pyx_L5_except_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;
      __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":466
 * 
 *         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":465
 *         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":453
 *             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_60upload(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_9_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_9_upload *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_9_upload(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_9_upload, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_upload *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(4, 453, __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":457
 *         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(4, 457, __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(4, 457, __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":458
 *         """
 *         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(4, 458, __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, 458, __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":460
 *         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(4, 460, __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(4, 460, __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":462
 *         buffer_size = buffer_size or DEFAULT_BUFFER_SIZE
 * 
 *         done = False             # <<<<<<<<<<<<<<
 *         exc_info = None
 * 
 */
  __pyx_cur_scope->__pyx_v_done = 0;

  /* "pyarrow/io.pxi":463
 * 
 *         done = False
 *         exc_info = None             # <<<<<<<<<<<<<<
 * 
 *         def bg_write():
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_exc_info = Py_None;

  /* "pyarrow/io.pxi":465
 *         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__121)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_bg_write = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io.pxi":478
 *                 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(4, 478, __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(4, 478, __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(4, 478, __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(4, 478, __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(4, 478, __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":479
 * 
 *         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(4, 479, __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(4, 479, __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":481
 *         writer_thread.start()
 * 
 *         try:             # <<<<<<<<<<<<<<
 *             while True:
 *                 buf = stream.read(buffer_size)
 */
  /*try:*/ {

    /* "pyarrow/io.pxi":482
 * 
 *         try:
 *             while True:             # <<<<<<<<<<<<<<
 *                 buf = stream.read(buffer_size)
 *                 if not buf:
 */
    while (1) {

      /* "pyarrow/io.pxi":483
 *         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(4, 483, __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(4, 483, __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":484
 *             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(4, 484, __pyx_L6_error)
      __pyx_t_5 = ((!__pyx_t_4) != 0);
      if (__pyx_t_5) {

        /* "pyarrow/io.pxi":485
 *                 buf = stream.read(buffer_size)
 *                 if not buf:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 if writer_thread.is_alive():
 */
        goto __pyx_L9_break;

        /* "pyarrow/io.pxi":484
 *             while True:
 *                 buf = stream.read(buffer_size)
 *                 if not buf:             # <<<<<<<<<<<<<<
 *                     break
 * 
 */
      }

      /* "pyarrow/io.pxi":487
 *                     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(4, 487, __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(4, 487, __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(4, 487, __pyx_L6_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_5) {

        /* "pyarrow/io.pxi":488
 * 
 *                 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(4, 488, __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(4, 488, __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(4, 488, __pyx_L6_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (!__pyx_t_5) break;

          /* "pyarrow/io.pxi":489
 *                 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(4, 489, __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(4, 489, __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(4, 489, __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":487
 *                     break
 * 
 *                 if writer_thread.is_alive():             # <<<<<<<<<<<<<<
 *                     while write_queue.full():
 *                         time.sleep(0.01)
 */
        goto __pyx_L11;
      }

      /* "pyarrow/io.pxi":491
 *                         time.sleep(0.01)
 *                 else:
 *                     break             # <<<<<<<<<<<<<<
 * 
 *                 write_queue.put_nowait(buf)
 */
      /*else*/ {
        goto __pyx_L9_break;
      }
      __pyx_L11:;

      /* "pyarrow/io.pxi":493
 *                     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(4, 493, __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(4, 493, __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":495
 *                 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":497
 *             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(4, 497, __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(4, 497, __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":498
 * 
 *         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":499
 *         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(4, 499, __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(4, 499, __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(4, 499, __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(4, 499, __pyx_L1_error)

    /* "pyarrow/io.pxi":498
 * 
 *         writer_thread.join()
 *         if exc_info is not None:             # <<<<<<<<<<<<<<
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 */
  }

  /* "pyarrow/io.pxi":453
 *             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;
}

/* "pyarrow/lib.pxd":353
 *         bint is_readable
 *         bint is_writable
 *         readonly bint closed             # <<<<<<<<<<<<<<
 *         bint own_file
 *         object __weakref__
 */

/* 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
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(11, 353, __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.NativeFile.closed.__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):             # <<<<<<<<<<<<<<
 *     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_63__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_62__reduce_cython__[] = "NativeFile.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_63__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_62__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_62__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__122, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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_65__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_10NativeFile_64__setstate_cython__[] = "NativeFile.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_10NativeFile_65__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_64__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_64__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__123, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":511
 *         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(4, 511, __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(4, 511, __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) {
  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;
  PyObject *__pyx_t_17 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);
  __Pyx_INCREF(__pyx_v_mode);

  /* "pyarrow/io.pxi":512
 * 
 *     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":514
 *         self.handle = handle
 * 
 *         if mode is None:             # <<<<<<<<<<<<<<
 *             try:
 *                 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":515
 * 
 *         if mode is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 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":516
 *         if mode is None:
 *             try:
 *                 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(4, 516, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_6);
        __pyx_t_6 = 0;

        /* "pyarrow/io.pxi":515
 * 
 *         if mode is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 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":517
 *             try:
 *                 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(4, 517, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_GOTREF(__pyx_t_9);

        /* "pyarrow/io.pxi":520
 *                 # Not all file-like objects have a mode attribute
 *                 # (e.g. BytesIO)
 *                 try:             # <<<<<<<<<<<<<<
 *                     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":521
 *                 # (e.g. BytesIO)
 *                 try:
 *                     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(4, 521, __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(4, 521, __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(4, 521, __pyx_L12_error)
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (__pyx_t_2) {
              __Pyx_INCREF(__pyx_n_s_w);
              __pyx_t_13 = __pyx_n_s_w;
            } else {
              __Pyx_INCREF(__pyx_n_s_r);
              __pyx_t_13 = __pyx_n_s_r;
            }
            __Pyx_DECREF_SET(__pyx_v_mode, __pyx_t_13);
            __pyx_t_13 = 0;

            /* "pyarrow/io.pxi":520
 *                 # Not all file-like objects have a mode attribute
 *                 # (e.g. BytesIO)
 *                 try:             # <<<<<<<<<<<<<<
 *                     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_16); __pyx_t_16 = 0;
          __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;

          /* "pyarrow/io.pxi":522
 *                 try:
 *                     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(4, 522, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_GOTREF(__pyx_t_15);

            /* "pyarrow/io.pxi":525
 *                     raise ValueError("could not infer open mode for file-like "
 *                                      "object %r, please pass it explicitly"
 *                                      % (handle,))             # <<<<<<<<<<<<<<
 *         if mode.startswith('w'):
 *             self.wr_file.reset(new PyOutputStream(handle))
 */
            __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 525, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_INCREF(__pyx_v_handle);
            __Pyx_GIVEREF(__pyx_v_handle);
            PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_handle);
            __pyx_t_17 = __Pyx_PyString_Format(__pyx_kp_s_could_not_infer_open_mode_for_fi, __pyx_t_16); if (unlikely(!__pyx_t_17)) __PYX_ERR(4, 525, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

            /* "pyarrow/io.pxi":523
 *                     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 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_17); if (unlikely(!__pyx_t_16)) __PYX_ERR(4, 523, __pyx_L14_except_error)
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_Raise(__pyx_t_16, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __PYX_ERR(4, 523, __pyx_L14_except_error)
          }
          goto __pyx_L14_except_error;
          __pyx_L14_except_error:;

          /* "pyarrow/io.pxi":520
 *                 # Not all file-like objects have a mode attribute
 *                 # (e.g. BytesIO)
 *                 try:             # <<<<<<<<<<<<<<
 *                     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":515
 * 
 *         if mode is None:
 *             try:             # <<<<<<<<<<<<<<
 *                 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":514
 *         self.handle = handle
 * 
 *         if mode is None:             # <<<<<<<<<<<<<<
 *             try:
 *                 mode = handle.mode
 */
  }

  /* "pyarrow/io.pxi":526
 *                                      "object %r, please pass it explicitly"
 *                                      % (handle,))
 *         if mode.startswith('w'):             # <<<<<<<<<<<<<<
 *             self.wr_file.reset(new PyOutputStream(handle))
 *             self.is_writable = True
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_mode, __pyx_n_s_startswith); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 526, __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_s_w) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_s_w);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 526, __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(4, 526, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":527
 *                                      % (handle,))
 *         if mode.startswith('w'):
 *             self.wr_file.reset(new PyOutputStream(handle))             # <<<<<<<<<<<<<<
 *             self.is_writable = True
 *         elif mode.startswith('r'):
 */
    __pyx_v_self->__pyx_base.wr_file.reset(new arrow::py::PyOutputStream(__pyx_v_handle));

    /* "pyarrow/io.pxi":528
 *         if mode.startswith('w'):
 *             self.wr_file.reset(new PyOutputStream(handle))
 *             self.is_writable = True             # <<<<<<<<<<<<<<
 *         elif mode.startswith('r'):
 *             self.rd_file.reset(new PyReadableFile(handle))
 */
    __pyx_v_self->__pyx_base.is_writable = 1;

    /* "pyarrow/io.pxi":526
 *                                      "object %r, please pass it explicitly"
 *                                      % (handle,))
 *         if mode.startswith('w'):             # <<<<<<<<<<<<<<
 *             self.wr_file.reset(new PyOutputStream(handle))
 *             self.is_writable = True
 */
    goto __pyx_L22;
  }

  /* "pyarrow/io.pxi":529
 *             self.wr_file.reset(new PyOutputStream(handle))
 *             self.is_writable = True
 *         elif mode.startswith('r'):             # <<<<<<<<<<<<<<
 *             self.rd_file.reset(new PyReadableFile(handle))
 *             self.is_readable = True
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_mode, __pyx_n_s_startswith); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 529, __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_s_r) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_n_s_r);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 529, __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(4, 529, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (likely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":530
 *             self.is_writable = True
 *         elif mode.startswith('r'):
 *             self.rd_file.reset(new PyReadableFile(handle))             # <<<<<<<<<<<<<<
 *             self.is_readable = True
 *         else:
 */
    __pyx_v_self->__pyx_base.rd_file.reset(new arrow::py::PyReadableFile(__pyx_v_handle));

    /* "pyarrow/io.pxi":531
 *         elif mode.startswith('r'):
 *             self.rd_file.reset(new PyReadableFile(handle))
 *             self.is_readable = True             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 */
    __pyx_v_self->__pyx_base.is_readable = 1;

    /* "pyarrow/io.pxi":529
 *             self.wr_file.reset(new PyOutputStream(handle))
 *             self.is_writable = True
 *         elif mode.startswith('r'):             # <<<<<<<<<<<<<<
 *             self.rd_file.reset(new PyReadableFile(handle))
 *             self.is_readable = True
 */
    goto __pyx_L22;
  }

  /* "pyarrow/io.pxi":533
 *             self.is_readable = True
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))             # <<<<<<<<<<<<<<
 * 
 *         self.closed = False
 */
  /*else*/ {
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Invalid_file_mode_0, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 533, __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(4, 533, __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(4, 533, __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(4, 533, __pyx_L1_error)
  }
  __pyx_L22:;

  /* "pyarrow/io.pxi":535
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 * 
 *         self.closed = False             # <<<<<<<<<<<<<<
 * 
 *     def truncate(self, pos=None):
 */
  __pyx_v_self->__pyx_base.closed = 0;

  /* "pyarrow/io.pxi":511
 *         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_17);
  __Pyx_AddTraceback("pyarrow.lib.PythonFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_mode);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":537
 *         self.closed = False
 * 
 *     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(4, 537, __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(4, 537, __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":538
 * 
 *     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(4, 538, __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(4, 538, __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":537
 *         self.closed = False
 * 
 *     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":540
 *         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(4, 540, __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(4, 540, __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":541
 * 
 *     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(4, 541, __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(4, 541, __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":540
 *         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":543
 *         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(4, 543, __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(4, 543, __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":544
 * 
 *     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(4, 544, __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(4, 544, __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":543
 *         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__124, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__125, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":556
 * 
 *     @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(4, 556, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "create") < 0)) __PYX_ERR(4, 556, __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(4, 556, __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;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("create", 0);

  /* "pyarrow/io.pxi":559
 *         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(4, 559, __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(4, 559, __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, 559, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io.pxi":560
 *             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(4, 560, __pyx_L1_error)
  __pyx_v_c_size = __pyx_t_5;

  /* "pyarrow/io.pxi":562
 *             int64_t c_size = size
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CMemoryMappedFile.Create(c_path, c_size, &handle))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":563
 * 
 *         with nogil:
 *             check_status(CMemoryMappedFile.Create(c_path, c_size, &handle))             # <<<<<<<<<<<<<<
 * 
 *         cdef MemoryMappedFile result = MemoryMappedFile()
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status( arrow::io::MemoryMappedFile::Create(__pyx_v_c_path, __pyx_v_c_size, (&__pyx_v_handle))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(4, 563, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":562
 *             int64_t c_size = size
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CMemoryMappedFile.Create(c_path, c_size, &handle))
 * 
 */
      /*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":565
 *             check_status(CMemoryMappedFile.Create(c_path, c_size, &handle))
 * 
 *         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(4, 565, __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":566
 * 
 *         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":567
 *         cdef MemoryMappedFile result = MemoryMappedFile()
 *         result.path = path
 *         result.is_readable = True             # <<<<<<<<<<<<<<
 *         result.is_writable = True
 *         result.wr_file = <shared_ptr[OutputStream]> handle
 */
  __pyx_v_result->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":568
 *         result.path = path
 *         result.is_readable = True
 *         result.is_writable = True             # <<<<<<<<<<<<<<
 *         result.wr_file = <shared_ptr[OutputStream]> handle
 *         result.rd_file = <shared_ptr[RandomAccessFile]> handle
 */
  __pyx_v_result->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":569
 *         result.is_readable = True
 *         result.is_writable = True
 *         result.wr_file = <shared_ptr[OutputStream]> handle             # <<<<<<<<<<<<<<
 *         result.rd_file = <shared_ptr[RandomAccessFile]> handle
 *         result.handle = handle
 */
  __pyx_v_result->__pyx_base.wr_file = ((std::shared_ptr<arrow::io::OutputStream> )__pyx_v_handle);

  /* "pyarrow/io.pxi":570
 *         result.is_writable = True
 *         result.wr_file = <shared_ptr[OutputStream]> handle
 *         result.rd_file = <shared_ptr[RandomAccessFile]> handle             # <<<<<<<<<<<<<<
 *         result.handle = handle
 *         result.closed = False
 */
  __pyx_v_result->__pyx_base.rd_file = ((std::shared_ptr<arrow::io::RandomAccessFile> )__pyx_v_handle);

  /* "pyarrow/io.pxi":571
 *         result.wr_file = <shared_ptr[OutputStream]> handle
 *         result.rd_file = <shared_ptr[RandomAccessFile]> handle
 *         result.handle = handle             # <<<<<<<<<<<<<<
 *         result.closed = False
 * 
 */
  __pyx_v_result->handle = __pyx_v_handle;

  /* "pyarrow/io.pxi":572
 *         result.rd_file = <shared_ptr[RandomAccessFile]> handle
 *         result.handle = handle
 *         result.closed = False             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_v_result->__pyx_base.closed = 0;

  /* "pyarrow/io.pxi":574
 *         result.closed = False
 * 
 *         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":556
 * 
 *     @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":576
 *         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='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_s_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(4, 576, __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(4, 576, __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;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("_open", 0);

  /* "pyarrow/io.pxi":577
 * 
 *     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":582
 *             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(4, 582, __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(4, 582, __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, 582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io.pxi":584
 *             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_PyString_Equals(__pyx_t_1, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 584, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_rb_2, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 584, __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":585
 * 
 *         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":586
 *         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":584
 *             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":587
 *             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_PyString_Equals(__pyx_t_1, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 587, __pyx_L1_error)
  if (!__pyx_t_5) {
  } else {
    __pyx_t_6 = __pyx_t_5;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_wb, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 587, __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":588
 *             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":589
 *         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":587
 *             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":590
 *             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_PyString_Equals(__pyx_t_1, __pyx_kp_s_r_2, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 590, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_r_b, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 590, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_kp_s_rb, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 590, __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":591
 *             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":592
 *         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":593
 *             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":590
 *             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":595
 *             self.is_writable = True
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Invalid_file_mode_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 595, __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(4, 595, __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(4, 595, __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, 595, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":597
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CMemoryMappedFile.Open(c_path, c_mode, &handle))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":598
 * 
 *         with nogil:
 *             check_status(CMemoryMappedFile.Open(c_path, c_mode, &handle))             # <<<<<<<<<<<<<<
 * 
 *         self.wr_file = <shared_ptr[OutputStream]> handle
 */
        __pyx_t_7 = __pyx_f_7pyarrow_3lib_check_status( arrow::io::MemoryMappedFile::Open(__pyx_v_c_path, __pyx_v_c_mode, (&__pyx_v_handle))); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(4, 598, __pyx_L12_error)
      }

      /* "pyarrow/io.pxi":597
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CMemoryMappedFile.Open(c_path, c_mode, &handle))
 * 
 */
      /*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":600
 *             check_status(CMemoryMappedFile.Open(c_path, c_mode, &handle))
 * 
 *         self.wr_file = <shared_ptr[OutputStream]> handle             # <<<<<<<<<<<<<<
 *         self.rd_file = <shared_ptr[RandomAccessFile]> handle
 *         self.handle = handle
 */
  __pyx_v_self->__pyx_base.wr_file = ((std::shared_ptr<arrow::io::OutputStream> )__pyx_v_handle);

  /* "pyarrow/io.pxi":601
 * 
 *         self.wr_file = <shared_ptr[OutputStream]> handle
 *         self.rd_file = <shared_ptr[RandomAccessFile]> handle             # <<<<<<<<<<<<<<
 *         self.handle = handle
 *         self.closed = False
 */
  __pyx_v_self->__pyx_base.rd_file = ((std::shared_ptr<arrow::io::RandomAccessFile> )__pyx_v_handle);

  /* "pyarrow/io.pxi":602
 *         self.wr_file = <shared_ptr[OutputStream]> handle
 *         self.rd_file = <shared_ptr[RandomAccessFile]> handle
 *         self.handle = handle             # <<<<<<<<<<<<<<
 *         self.closed = False
 * 
 */
  __pyx_v_self->handle = __pyx_v_handle;

  /* "pyarrow/io.pxi":603
 *         self.rd_file = <shared_ptr[RandomAccessFile]> handle
 *         self.handle = handle
 *         self.closed = False             # <<<<<<<<<<<<<<
 * 
 *     def resize(self, new_size):
 */
  __pyx_v_self->__pyx_base.closed = 0;

  /* "pyarrow/io.pxi":576
 *         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":605
 *         self.closed = False
 * 
 *     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":613
 *         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(4, 613, __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(4, 613, __pyx_L1_error)

  /* "pyarrow/io.pxi":605
 *         self.closed = False
 * 
 *     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":615
 *         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":616
 * 
 *     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(4, 616, __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, 616, __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":617
 *     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(4, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":615
 *         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__126, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__127, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":620
 * 
 * 
 * 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_105memory_map(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_104memory_map[] = "memory_map(path, mode='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', 'w'}, default 'r'\n\n    Returns\n    -------\n    mmap : MemoryMappedFile\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_105memory_map = {"memory_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_105memory_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_104memory_map};
static PyObject *__pyx_pw_7pyarrow_3lib_105memory_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_s_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(4, 620, __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(4, 620, __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_104memory_map(__pyx_self, __pyx_v_path, __pyx_v_mode);

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

static PyObject *__pyx_pf_7pyarrow_3lib_104memory_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":633
 *     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(4, 633, __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":634
 *     """
 *     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(4, 634, __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(4, 634, __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(4, 634, __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, 634, __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(4, 634, __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":635
 *     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":620
 * 
 * 
 * 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":638
 * 
 * 
 * def create_memory_map(path, size):             # <<<<<<<<<<<<<<
 *     """
 *     Create memory map at indicated path of the given size, return open
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_107create_memory_map(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_106create_memory_map[] = "create_memory_map(path, size)\n\n    Create memory map at indicated path of the given size, return open\n    writable file object\n\n    Parameters\n    ----------\n    path : string\n    size : int\n\n    Returns\n    -------\n    mmap : MemoryMappedFile\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_107create_memory_map = {"create_memory_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_107create_memory_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_106create_memory_map};
static PyObject *__pyx_pw_7pyarrow_3lib_107create_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(4, 638, __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(4, 638, __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(4, 638, __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_106create_memory_map(__pyx_self, __pyx_v_path, __pyx_v_size);

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

static PyObject *__pyx_pf_7pyarrow_3lib_106create_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":652
 *     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(4, 652, __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(4, 652, __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(4, 652, __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, 652, __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(4, 652, __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":638
 * 
 * 
 * def create_memory_map(path, size):             # <<<<<<<<<<<<<<
 *     """
 *     Create memory map at indicated path of the given size, return open
 */

  /* 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":662
 *         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_s_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(4, 662, __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(4, 662, __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(4, 662, __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":663
 * 
 *     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":668
 *             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(4, 668, __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(4, 668, __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, 668, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_c_path = __pyx_t_4;

  /* "pyarrow/io.pxi":670
 *             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_PyString_Equals(__pyx_t_1, __pyx_n_s_r, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 670, __pyx_L1_error)
  if (!__pyx_t_6) {
  } else {
    __pyx_t_5 = __pyx_t_6;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_rb_2, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 670, __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":671
 * 
 *         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(4, 671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/io.pxi":670
 *             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":672
 *         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_PyString_Equals(__pyx_t_1, __pyx_n_s_w, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 672, __pyx_L1_error)
  if (!__pyx_t_5) {
  } else {
    __pyx_t_6 = __pyx_t_5;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_wb, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(4, 672, __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":673
 *             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(4, 673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/io.pxi":672
 *         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":675
 *             self._open_writable(c_path)
 *         else:
 *             raise ValueError('Invalid file mode: {0}'.format(mode))             # <<<<<<<<<<<<<<
 * 
 *         self.closed = False
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Invalid_file_mode_0, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 675, __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(4, 675, __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(4, 675, __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, 675, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":677
 *             raise ValueError('Invalid file mode: {0}'.format(mode))
 * 
 *         self.closed = False             # <<<<<<<<<<<<<<
 * 
 *     cdef _open_readable(self, c_string path, CMemoryPool* pool):
 */
  __pyx_v_self->__pyx_base.closed = 0;

  /* "pyarrow/io.pxi":662
 *         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":679
 *         self.closed = False
 * 
 *     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
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_open_readable", 0);

  /* "pyarrow/io.pxi":682
 *         cdef shared_ptr[ReadableFile] handle
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ReadableFile.Open(path, pool, &handle))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":683
 * 
 *         with nogil:
 *             check_status(ReadableFile.Open(path, pool, &handle))             # <<<<<<<<<<<<<<
 * 
 *         self.is_readable = True
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::io::ReadableFile::Open(__pyx_v_path, __pyx_v_pool, (&__pyx_v_handle))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 683, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":682
 *         cdef shared_ptr[ReadableFile] handle
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(ReadableFile.Open(path, pool, &handle))
 * 
 */
      /*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":685
 *             check_status(ReadableFile.Open(path, pool, &handle))
 * 
 *         self.is_readable = True             # <<<<<<<<<<<<<<
 *         self.rd_file = <shared_ptr[RandomAccessFile]> handle
 * 
 */
  __pyx_v_self->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":686
 * 
 *         self.is_readable = True
 *         self.rd_file = <shared_ptr[RandomAccessFile]> handle             # <<<<<<<<<<<<<<
 * 
 *     cdef _open_writable(self, c_string path):
 */
  __pyx_v_self->__pyx_base.rd_file = ((std::shared_ptr<arrow::io::RandomAccessFile> )__pyx_v_handle);

  /* "pyarrow/io.pxi":679
 *         self.closed = False
 * 
 *     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_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":688
 *         self.rd_file = <shared_ptr[RandomAccessFile]> handle
 * 
 *     cdef _open_writable(self, c_string path):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(FileOutputStream.Open(path, &self.wr_file))
 */

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
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_open_writable", 0);

  /* "pyarrow/io.pxi":689
 * 
 *     cdef _open_writable(self, c_string path):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(FileOutputStream.Open(path, &self.wr_file))
 *         self.is_writable = True
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":690
 *     cdef _open_writable(self, c_string path):
 *         with nogil:
 *             check_status(FileOutputStream.Open(path, &self.wr_file))             # <<<<<<<<<<<<<<
 *         self.is_writable = True
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::io::FileOutputStream::Open(__pyx_v_path, (&__pyx_v_self->__pyx_base.wr_file))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 690, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":689
 * 
 *     cdef _open_writable(self, c_string path):
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(FileOutputStream.Open(path, &self.wr_file))
 *         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":691
 *         with nogil:
 *             check_status(FileOutputStream.Open(path, &self.wr_file))
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 * 
 *     def fileno(self):
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":688
 *         self.rd_file = <shared_ptr[RandomAccessFile]> handle
 * 
 *     cdef _open_writable(self, c_string path):             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(FileOutputStream.Open(path, &self.wr_file))
 */

  /* 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":693
 *         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":694
 * 
 *     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(4, 694, __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, 694, __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":695
 *     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(4, 695, __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(4, 695, __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, 695, __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":693
 *         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__128, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__129, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":700
 * cdef class FixedSizeBufferWriter(NativeFile):
 * 
 *     def __cinit__(self, Buffer buffer):             # <<<<<<<<<<<<<<
 *         self.wr_file.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(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_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(4, 700, __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(4, 700, __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":701
 * 
 *     def __cinit__(self, Buffer buffer):
 *         self.wr_file.reset(new CFixedSizeBufferWriter(buffer.buffer))             # <<<<<<<<<<<<<<
 *         self.is_writable = True
 *         self.closed = False
 */
  __pyx_v_self->__pyx_base.wr_file.reset(new  arrow::io::FixedSizeBufferWriter(__pyx_v_buffer->buffer));

  /* "pyarrow/io.pxi":702
 *     def __cinit__(self, Buffer buffer):
 *         self.wr_file.reset(new CFixedSizeBufferWriter(buffer.buffer))
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 *         self.closed = False
 * 
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":703
 *         self.wr_file.reset(new CFixedSizeBufferWriter(buffer.buffer))
 *         self.is_writable = True
 *         self.closed = False             # <<<<<<<<<<<<<<
 * 
 *     def set_memcopy_threads(self, int num_threads):
 */
  __pyx_v_self->__pyx_base.closed = 0;

  /* "pyarrow/io.pxi":700
 * cdef class FixedSizeBufferWriter(NativeFile):
 * 
 *     def __cinit__(self, Buffer buffer):             # <<<<<<<<<<<<<<
 *         self.wr_file.reset(new CFixedSizeBufferWriter(buffer.buffer))
 *         self.is_writable = True
 */

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

/* "pyarrow/io.pxi":705
 *         self.closed = False
 * 
 *     def set_memcopy_threads(self, int num_threads):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.wr_file.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(4, 705, __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":707
 *     def set_memcopy_threads(self, int num_threads):
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.wr_file.get()             # <<<<<<<<<<<<<<
 *         writer.set_memcopy_threads(num_threads)
 * 
 */
  __pyx_v_writer = (( arrow::io::FixedSizeBufferWriter *)__pyx_v_self->__pyx_base.wr_file.get());

  /* "pyarrow/io.pxi":708
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.wr_file.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":705
 *         self.closed = False
 * 
 *     def set_memcopy_threads(self, int num_threads):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.wr_file.get()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":710
 *         writer.set_memcopy_threads(num_threads)
 * 
 *     def set_memcopy_blocksize(self, int64_t blocksize):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.wr_file.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(4, 710, __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":712
 *     def set_memcopy_blocksize(self, int64_t blocksize):
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.wr_file.get()             # <<<<<<<<<<<<<<
 *         writer.set_memcopy_blocksize(blocksize)
 * 
 */
  __pyx_v_writer = (( arrow::io::FixedSizeBufferWriter *)__pyx_v_self->__pyx_base.wr_file.get());

  /* "pyarrow/io.pxi":713
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.wr_file.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":710
 *         writer.set_memcopy_threads(num_threads)
 * 
 *     def set_memcopy_blocksize(self, int64_t blocksize):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.wr_file.get()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":715
 *         writer.set_memcopy_blocksize(blocksize)
 * 
 *     def set_memcopy_threshold(self, int64_t threshold):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.wr_file.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(4, 715, __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":717
 *     def set_memcopy_threshold(self, int64_t threshold):
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.wr_file.get()             # <<<<<<<<<<<<<<
 *         writer.set_memcopy_threshold(threshold)
 * 
 */
  __pyx_v_writer = (( arrow::io::FixedSizeBufferWriter *)__pyx_v_self->__pyx_base.wr_file.get());

  /* "pyarrow/io.pxi":718
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.wr_file.get()
 *         writer.set_memcopy_threshold(threshold)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_writer->set_memcopy_threshold(__pyx_v_threshold);

  /* "pyarrow/io.pxi":715
 *         writer.set_memcopy_blocksize(blocksize)
 * 
 *     def set_memcopy_threshold(self, int64_t threshold):             # <<<<<<<<<<<<<<
 *         cdef CFixedSizeBufferWriter* writer = \
 *             <CFixedSizeBufferWriter*> self.wr_file.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__130, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__131, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":727
 * cdef class Buffer:
 * 
 *     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":730
 *         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":731
 * 
 *     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__132, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 731, __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, 731, __pyx_L1_error)

  /* "pyarrow/io.pxi":730
 *         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":734
 *                         "`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":735
 * 
 *     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":736
 *     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(4, 736, __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(4, 736, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  (__pyx_v_self->shape[0]) = __pyx_t_2;

  /* "pyarrow/io.pxi":737
 *         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":734
 *                         "`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":739
 *         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":740
 * 
 *     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(4, 740, __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(4, 740, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":739
 *         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":743
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self.buffer.get().size()
 * 
 */

/* 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":744
 *     @property
 *     def size(self):
 *         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(4, 744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":743
 * 
 *     @property
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return self.buffer.get().size()
 * 
 */

  /* 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":747
 * 
 *     @property
 *     def address(self):             # <<<<<<<<<<<<<<
 *         return <uintptr_t> self.buffer.get().data()
 * 
 */

/* 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":748
 *     @property
 *     def address(self):
 *         return <uintptr_t> self.buffer.get().data()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __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(4, 748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":747
 * 
 *     @property
 *     def address(self):             # <<<<<<<<<<<<<<
 *         return <uintptr_t> self.buffer.get().data()
 * 
 */

  /* 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":751
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         return self.buffer.get().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":752
 *     @property
 *     def is_mutable(self):
 *         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(4, 752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":751
 * 
 *     @property
 *     def is_mutable(self):             # <<<<<<<<<<<<<<
 *         return self.buffer.get().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":755
 * 
 *     @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":756
 *     @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":758
 *         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":759
 * 
 *         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":758
 *         cdef shared_ptr[CBuffer] parent_buf = self.buffer.get().parent()
 * 
 *         if parent_buf.get() == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         else:
 */
  }

  /* "pyarrow/io.pxi":761
 *             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(4, 761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":755
 * 
 *     @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":763
 *             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_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_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_6Buffer_6__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_6__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":764
 * 
 *     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":765
 *     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(4, 765, __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(4, 765, __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(4, 765, __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(4, 765, __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(4, 765, __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":764
 * 
 *     def __getitem__(self, key):
 *         if PySlice_Check(key):             # <<<<<<<<<<<<<<
 *             return _normalize_slice(self, key)
 * 
 */
  }

  /* "pyarrow/io.pxi":767
 *             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(4, 767, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 767, __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(4, 767, __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(4, 767, __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(4, 767, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":763
 *             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":769
 *         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":770
 * 
 *     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(4, 770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":769
 *         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":772
 *         return self.buffer.get().data()[i]
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute slice of this buffer
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_9slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Buffer_8slice[] = "Buffer.slice(self, offset=0, length=None)\n\n        Compute slice of this buffer\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        ";
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_9slice(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(4, 772, __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(4, 772, __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_8slice(((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_8slice(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":790
 *         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(4, 790, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 790, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":791
 * 
 *         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__83, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 791, __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, 791, __pyx_L1_error)

    /* "pyarrow/io.pxi":790
 *         cdef shared_ptr[CBuffer] result
 * 
 *         if offset < 0:             # <<<<<<<<<<<<<<
 *             raise IndexError('Offset must be non-negative')
 * 
 */
  }

  /* "pyarrow/io.pxi":793
 *             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":794
 * 
 *         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(4, 794, __pyx_L1_error)
    __pyx_v_result = arrow::SliceBuffer(__pyx_v_self->buffer, __pyx_t_4);

    /* "pyarrow/io.pxi":793
 *             raise IndexError('Offset must be non-negative')
 * 
 *         if length is None:             # <<<<<<<<<<<<<<
 *             result = SliceBuffer(self.buffer, offset)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/io.pxi":796
 *             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(4, 796, __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(4, 796, __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(4, 796, __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(4, 796, __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(4, 796, __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(4, 796, __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":798
 *             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(4, 798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":772
 *         return self.buffer.get().data()[i]
 * 
 *     def slice(self, offset=0, length=None):             # <<<<<<<<<<<<<<
 *         """
 *         Compute slice of this buffer
 */

  /* 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":800
 *         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_11equals(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Buffer_10equals[] = "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_11equals(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(4, 800, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_6Buffer_10equals(((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_10equals(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":812
 *         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":813
 *         """
 *         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":814
 *         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":813
 *         """
 *         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":815
 *         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(4, 815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":800
 *         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":817
 *         return result
 * 
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         if isinstance(other, Buffer):
 *             return self.equals(other)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_13__eq__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_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_6Buffer_12__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_12__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;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "pyarrow/io.pxi":818
 * 
 *     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":819
 *     def __eq__(self, other):
 *         if isinstance(other, Buffer):
 *             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(4, 819, __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(4, 819, __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":818
 * 
 *     def __eq__(self, other):
 *         if isinstance(other, Buffer):             # <<<<<<<<<<<<<<
 *             return self.equals(other)
 *         else:
 */
  }

  /* "pyarrow/io.pxi":821
 *             return self.equals(other)
 *         else:
 *             return NotImplemented             # <<<<<<<<<<<<<<
 * 
 *     def __reduce_ex__(self, protocol):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_builtin_NotImplemented);
    __pyx_r = __pyx_builtin_NotImplemented;
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":817
 *         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_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":823
 *             return NotImplemented
 * 
 *     def __reduce_ex__(self, protocol):             # <<<<<<<<<<<<<<
 *         if protocol >= 5:
 *             return py_buffer, (builtin_pickle.PickleBuffer(self),)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_15__reduce_ex__(PyObject *__pyx_v_self, PyObject *__pyx_v_protocol); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Buffer_14__reduce_ex__[] = "Buffer.__reduce_ex__(self, protocol)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_15__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_14__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_14__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":824
 * 
 *     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(4, 824, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 824, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":825
 *     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(4, 825, __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(4, 825, __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(4, 825, __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(4, 825, __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(4, 825, __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(4, 825, __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":824
 * 
 *     def __reduce_ex__(self, protocol):
 *         if protocol >= 5:             # <<<<<<<<<<<<<<
 *             return py_buffer, (builtin_pickle.PickleBuffer(self),)
 *         else:
 */
  }

  /* "pyarrow/io.pxi":827
 *             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(4, 827, __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(4, 827, __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(4, 827, __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(4, 827, __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(4, 827, __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":823
 *             return NotImplemented
 * 
 *     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":829
 *             return py_buffer, (self.to_pybytes(),)
 * 
 *     def to_pybytes(self):             # <<<<<<<<<<<<<<
 *         return cp.PyBytes_FromStringAndSize(
 *             <const char*>self.buffer.get().data(),
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_17to_pybytes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_6Buffer_16to_pybytes[] = "Buffer.to_pybytes(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_6Buffer_17to_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_16to_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_16to_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":830
 * 
 *     def to_pybytes(self):
 *         return cp.PyBytes_FromStringAndSize(             # <<<<<<<<<<<<<<
 *             <const char*>self.buffer.get().data(),
 *             self.buffer.get().size())
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyarrow/io.pxi":832
 *         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(4, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":829
 *             return py_buffer, (self.to_pybytes(),)
 * 
 *     def to_pybytes(self):             # <<<<<<<<<<<<<<
 *         return cp.PyBytes_FromStringAndSize(
 *             <const char*>self.buffer.get().data(),
 */

  /* 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":834
 *             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_19__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_buffer, int __pyx_v_flags); /*proto*/
static CYTHON_UNUSED int __pyx_pw_7pyarrow_3lib_6Buffer_19__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_18__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_18__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":835
 * 
 *     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":836
 *     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":835
 * 
 *     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":838
 *             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":839
 *         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__133, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 839, __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, 839, __pyx_L1_error)

      /* "pyarrow/io.pxi":838
 *             buffer.readonly = 0
 *         else:
 *             if flags & cp.PyBUF_WRITABLE:             # <<<<<<<<<<<<<<
 *                 raise BufferError("Writable buffer requested but Arrow "
 *                                   "buffer was not mutable")
 */
    }

    /* "pyarrow/io.pxi":841
 *                 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":842
 *                                   "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":843
 *             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":844
 *         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":845
 *         buffer.format = 'b'
 *         buffer.internal = NULL
 *         buffer.itemsize = 1             # <<<<<<<<<<<<<<
 *         buffer.len = self.size
 *         buffer.ndim = 1
 */
  __pyx_v_buffer->itemsize = 1;

  /* "pyarrow/io.pxi":846
 *         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(4, 846, __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(4, 846, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_buffer->len = __pyx_t_3;

  /* "pyarrow/io.pxi":847
 *         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":848
 *         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":849
 *         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":850
 *         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":851
 *         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":834
 *             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":853
 *         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_21__getsegcount__(PyObject *__pyx_v_self, Py_ssize_t *__pyx_v_len_out); /*proto*/
static Py_ssize_t __pyx_pw_7pyarrow_3lib_6Buffer_21__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_20__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_20__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":854
 * 
 *     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":855
 *     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(4, 855, __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(4, 855, __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":854
 * 
 *     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":856
 *         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":853
 *         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":858
 *         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_23__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_23__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_22__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_22__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":859
 * 
 *     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":860
 *     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__134, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 860, __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, 860, __pyx_L1_error)

    /* "pyarrow/io.pxi":859
 * 
 *     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":861
 *         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":862
 *             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":861
 *         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":863
 *         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(4, 863, __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(4, 863, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":858
 *         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":865
 *         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_25__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_25__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_24__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_24__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":866
 * 
 *     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":867
 *     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__135, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 867, __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, 867, __pyx_L1_error)

    /* "pyarrow/io.pxi":866
 * 
 *     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":868
 *         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":869
 *             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__134, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 869, __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, 869, __pyx_L1_error)

    /* "pyarrow/io.pxi":868
 *         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":870
 *         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":871
 *             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":870
 *         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":872
 *         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(4, 872, __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(4, 872, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":865
 *         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":877
 * cdef class ResizableBuffer(Buffer):
 * 
 *     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":878
 * 
 *     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":877
 * cdef class ResizableBuffer(Buffer):
 * 
 *     cdef void init_rz(self, const shared_ptr[CResizableBuffer]& buffer):             # <<<<<<<<<<<<<<
 *         self.init(<shared_ptr[CBuffer]> buffer)
 * 
 */

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

/* "pyarrow/io.pxi":880
 *         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 : int64_t\n            New size of buffer (padding may be added internally)\n        shrink_to_fit : boolean, default False\n            If new_size is less than the current size, shrink internal\n            capacity, otherwise leave at current capacity\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(4, 880, __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(4, 880, __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(4, 880, __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":892
 *             capacity, otherwise leave at current capacity
 *         """
 *         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(4, 892, __pyx_L1_error)
  __pyx_v_c_shrink_to_fit = __pyx_t_1;

  /* "pyarrow/io.pxi":893
 *         """
 *         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":894
 *         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(4, 894, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":893
 *         """
 *         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":880
 *         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":898
 * 
 * 
 * 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":900
 * 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":901
 *     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(4, 901, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":900
 * 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":902
 *     with nogil:
 *         check_status(AllocateResizableBuffer(pool, 0, &result))
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":898
 * 
 * 
 * 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":905
 * 
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,             # <<<<<<<<<<<<<<
 *                     resizable=False):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_109allocate_buffer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_108allocate_buffer[] = "allocate_buffer(int64_t size, MemoryPool memory_pool=None, resizable=False)\n\n    Allocate mutable fixed-size buffer\n\n    Parameters\n    ----------\n    size : int\n        Number of bytes to allocate (plus internal padding)\n    memory_pool : MemoryPool, optional\n        Uses default memory pool if not provided\n    resizable : boolean, default False\n\n    Returns\n    -------\n    buffer : Buffer or ResizableBuffer\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_109allocate_buffer = {"allocate_buffer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_109allocate_buffer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_108allocate_buffer};
static PyObject *__pyx_pw_7pyarrow_3lib_109allocate_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":906
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,
 *                     resizable=False):             # <<<<<<<<<<<<<<
 *     """
 *     Allocate mutable fixed-size 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(4, 905, __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(4, 905, __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(4, 905, __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(4, 905, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_108allocate_buffer(__pyx_self, __pyx_v_size, __pyx_v_memory_pool, __pyx_v_resizable);

  /* "pyarrow/io.pxi":905
 * 
 * 
 * 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_108allocate_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":925
 *         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":927
 *         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(4, 927, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":928
 * 
 *     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":929
 *     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(4, 929, __pyx_L5_error)
        }

        /* "pyarrow/io.pxi":928
 * 
 *     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":930
 *         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(4, 930, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":927
 *         CMemoryPool* cpool = maybe_unbox_memory_pool(memory_pool)
 * 
 *     if resizable:             # <<<<<<<<<<<<<<
 *         with nogil:
 *             check_status(AllocateResizableBuffer(cpool, size, &rz_buffer))
 */
  }

  /* "pyarrow/io.pxi":932
 *         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":933
 *     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(4, 933, __pyx_L8_error)
        }

        /* "pyarrow/io.pxi":932
 *         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":934
 *         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(4, 934, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":905
 * 
 * 
 * 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":942
 *         shared_ptr[CResizableBuffer] buffer
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         self.buffer = _allocate_buffer(maybe_unbox_memory_pool(memory_pool))
 *         self.wr_file.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(4, 942, __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(4, 942, __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(4, 942, __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":943
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):
 *         self.buffer = _allocate_buffer(maybe_unbox_memory_pool(memory_pool))             # <<<<<<<<<<<<<<
 *         self.wr_file.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":944
 *     def __cinit__(self, MemoryPool memory_pool=None):
 *         self.buffer = _allocate_buffer(maybe_unbox_memory_pool(memory_pool))
 *         self.wr_file.reset(new CBufferOutputStream(             # <<<<<<<<<<<<<<
 *             <shared_ptr[CResizableBuffer]> self.buffer))
 *         self.is_writable = True
 */
  __pyx_v_self->__pyx_base.wr_file.reset(new  arrow::io::BufferOutputStream(((std::shared_ptr< arrow::ResizableBuffer> )__pyx_v_self->buffer)));

  /* "pyarrow/io.pxi":946
 *         self.wr_file.reset(new CBufferOutputStream(
 *             <shared_ptr[CResizableBuffer]> self.buffer))
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 *         self.closed = False
 * 
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":947
 *             <shared_ptr[CResizableBuffer]> self.buffer))
 *         self.is_writable = True
 *         self.closed = False             # <<<<<<<<<<<<<<
 * 
 *     def getvalue(self):
 */
  __pyx_v_self->__pyx_base.closed = 0;

  /* "pyarrow/io.pxi":942
 *         shared_ptr[CResizableBuffer] buffer
 * 
 *     def __cinit__(self, MemoryPool memory_pool=None):             # <<<<<<<<<<<<<<
 *         self.buffer = _allocate_buffer(maybe_unbox_memory_pool(memory_pool))
 *         self.wr_file.reset(new CBufferOutputStream(
 */

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

/* "pyarrow/io.pxi":949
 *         self.closed = False
 * 
 *     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":957
 *         value : Buffer
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.wr_file.get().Close())
 *         self.closed = True
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":958
 *         """
 *         with nogil:
 *             check_status(self.wr_file.get().Close())             # <<<<<<<<<<<<<<
 *         self.closed = True
 *         return pyarrow_wrap_buffer(<shared_ptr[CBuffer]> self.buffer)
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->__pyx_base.wr_file.get()->Close()); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 958, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":957
 *         value : Buffer
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.wr_file.get().Close())
 *         self.closed = 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":959
 *         with nogil:
 *             check_status(self.wr_file.get().Close())
 *         self.closed = True             # <<<<<<<<<<<<<<
 *         return pyarrow_wrap_buffer(<shared_ptr[CBuffer]> self.buffer)
 * 
 */
  __pyx_v_self->__pyx_base.closed = 1;

  /* "pyarrow/io.pxi":960
 *             check_status(self.wr_file.get().Close())
 *         self.closed = True
 *         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(4, 960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":949
 *         self.closed = False
 * 
 *     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__136, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__137, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":965
 * cdef class MockOutputStream(NativeFile):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.wr_file.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":966
 * 
 *     def __cinit__(self):
 *         self.wr_file.reset(new CMockOutputStream())             # <<<<<<<<<<<<<<
 *         self.is_writable = True
 *         self.closed = False
 */
  __pyx_v_self->__pyx_base.wr_file.reset(new  arrow::io::MockOutputStream());

  /* "pyarrow/io.pxi":967
 *     def __cinit__(self):
 *         self.wr_file.reset(new CMockOutputStream())
 *         self.is_writable = True             # <<<<<<<<<<<<<<
 *         self.closed = False
 * 
 */
  __pyx_v_self->__pyx_base.is_writable = 1;

  /* "pyarrow/io.pxi":968
 *         self.wr_file.reset(new CMockOutputStream())
 *         self.is_writable = True
 *         self.closed = False             # <<<<<<<<<<<<<<
 * 
 *     def size(self):
 */
  __pyx_v_self->__pyx_base.closed = 0;

  /* "pyarrow/io.pxi":965
 * cdef class MockOutputStream(NativeFile):
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.wr_file.reset(new CMockOutputStream())
 *         self.is_writable = True
 */

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

/* "pyarrow/io.pxi":970
 *         self.closed = False
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return (<CMockOutputStream*>self.wr_file.get()).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) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("size", 0);

  /* "pyarrow/io.pxi":971
 * 
 *     def size(self):
 *         return (<CMockOutputStream*>self.wr_file.get()).GetExtentBytesWritten()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t((( arrow::io::MockOutputStream *)__pyx_v_self->__pyx_base.wr_file.get())->GetExtentBytesWritten()); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":970
 *         self.closed = False
 * 
 *     def size(self):             # <<<<<<<<<<<<<<
 *         return (<CMockOutputStream*>self.wr_file.get()).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__138, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__139, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":985
 *         Buffer buffer
 * 
 *     def __cinit__(self, object obj):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(obj, Buffer):
 */

/* 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(4, 985, __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(4, 985, __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
  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("__cinit__", 0);

  /* "pyarrow/io.pxi":987
 *     def __cinit__(self, object obj):
 * 
 *         if isinstance(obj, Buffer):             # <<<<<<<<<<<<<<
 *             self.buffer = obj
 *         else:
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":988
 * 
 *         if isinstance(obj, Buffer):
 *             self.buffer = obj             # <<<<<<<<<<<<<<
 *         else:
 *             self.buffer = py_buffer(obj)
 */
    if (!(likely(((__pyx_v_obj) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_obj, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(4, 988, __pyx_L1_error)
    __pyx_t_3 = __pyx_v_obj;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __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_3);
    __pyx_t_3 = 0;

    /* "pyarrow/io.pxi":987
 *     def __cinit__(self, object obj):
 * 
 *         if isinstance(obj, Buffer):             # <<<<<<<<<<<<<<
 *             self.buffer = obj
 *         else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/io.pxi":990
 *             self.buffer = obj
 *         else:
 *             self.buffer = py_buffer(obj)             # <<<<<<<<<<<<<<
 * 
 *         self.rd_file.reset(new CBufferReader(self.buffer.buffer))
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 990, __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(4, 990, __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_Buffer))))) __PYX_ERR(4, 990, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __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_3);
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/io.pxi":992
 *             self.buffer = py_buffer(obj)
 * 
 *         self.rd_file.reset(new CBufferReader(self.buffer.buffer))             # <<<<<<<<<<<<<<
 *         self.is_readable = True
 *         self.closed = False
 */
  __pyx_v_self->__pyx_base.rd_file.reset(new  arrow::io::BufferReader(__pyx_v_self->buffer->buffer));

  /* "pyarrow/io.pxi":993
 * 
 *         self.rd_file.reset(new CBufferReader(self.buffer.buffer))
 *         self.is_readable = True             # <<<<<<<<<<<<<<
 *         self.closed = False
 * 
 */
  __pyx_v_self->__pyx_base.is_readable = 1;

  /* "pyarrow/io.pxi":994
 *         self.rd_file.reset(new CBufferReader(self.buffer.buffer))
 *         self.is_readable = True
 *         self.closed = False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx_base.closed = 0;

  /* "pyarrow/io.pxi":985
 *         Buffer buffer
 * 
 *     def __cinit__(self, object obj):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(obj, Buffer):
 */

  /* 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.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__140, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__141, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":997
 * 
 * 
 * def py_buffer(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer from a Python bytes object
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_111py_buffer(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_110py_buffer[] = "py_buffer(obj)\n\n    Construct an Arrow buffer from a Python bytes object\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_111py_buffer = {"py_buffer", (PyCFunction)__pyx_pw_7pyarrow_3lib_111py_buffer, METH_O, __pyx_doc_7pyarrow_3lib_110py_buffer};
static PyObject *__pyx_pw_7pyarrow_3lib_111py_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_110py_buffer(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_110py_buffer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  std::shared_ptr< arrow::Buffer>  __pyx_v_buf;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("py_buffer", 0);

  /* "pyarrow/io.pxi":1002
 *     """
 *     cdef shared_ptr[CBuffer] buf
 *     check_status(PyBuffer.FromPyObject(obj, &buf))             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_buffer(buf)
 * 
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::PyBuffer::FromPyObject(__pyx_v_obj, (&__pyx_v_buf))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 1002, __pyx_L1_error)

  /* "pyarrow/io.pxi":1003
 *     cdef shared_ptr[CBuffer] buf
 *     check_status(PyBuffer.FromPyObject(obj, &buf))
 *     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(4, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":997
 * 
 * 
 * def py_buffer(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer from a Python bytes 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":1006
 * 
 * 
 * def foreign_buffer(address, size, base):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer with the given *address* and *size*,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_113foreign_buffer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_112foreign_buffer[] = "foreign_buffer(address, size, base)\n\n    Construct an Arrow buffer with the given *address* and *size*,\n    backed by the Python *base* object.\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_113foreign_buffer = {"foreign_buffer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_113foreign_buffer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_112foreign_buffer};
static PyObject *__pyx_pw_7pyarrow_3lib_113foreign_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};
    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", 1, 3, 3, 1); __PYX_ERR(4, 1006, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_base)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("foreign_buffer", 1, 3, 3, 2); __PYX_ERR(4, 1006, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "foreign_buffer") < 0)) __PYX_ERR(4, 1006, __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_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", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1006, __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_112foreign_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_112foreign_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":1012
 *     """
 *     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(4, 1012, __pyx_L1_error)
  __pyx_v_c_addr = __pyx_t_1;

  /* "pyarrow/io.pxi":1013
 *     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(4, 1013, __pyx_L1_error)
  __pyx_v_c_size = __pyx_t_2;

  /* "pyarrow/io.pxi":1016
 *         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(4, 1016, __pyx_L1_error)

  /* "pyarrow/io.pxi":1018
 *     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(4, 1018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1006
 * 
 * 
 * def foreign_buffer(address, size, base):             # <<<<<<<<<<<<<<
 *     """
 *     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":1021
 * 
 * 
 * def as_buffer(object o):             # <<<<<<<<<<<<<<
 *     if isinstance(o, Buffer):
 *         return o
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_115as_buffer(PyObject *__pyx_self, PyObject *__pyx_v_o); /*proto*/
static char __pyx_doc_7pyarrow_3lib_114as_buffer[] = "as_buffer(o)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_115as_buffer = {"as_buffer", (PyCFunction)__pyx_pw_7pyarrow_3lib_115as_buffer, METH_O, __pyx_doc_7pyarrow_3lib_114as_buffer};
static PyObject *__pyx_pw_7pyarrow_3lib_115as_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_114as_buffer(__pyx_self, ((PyObject *)__pyx_v_o));

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

static PyObject *__pyx_pf_7pyarrow_3lib_114as_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":1022
 * 
 * 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":1023
 * 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":1022
 * 
 * def as_buffer(object o):
 *     if isinstance(o, Buffer):             # <<<<<<<<<<<<<<
 *         return o
 *     return py_buffer(o)
 */
  }

  /* "pyarrow/io.pxi":1024
 *     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(4, 1024, __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(4, 1024, __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":1021
 * 
 * 
 * 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":1027
 * 
 * 
 * cdef get_reader(object source, c_bool use_memory_map,             # <<<<<<<<<<<<<<
 *                 shared_ptr[RandomAccessFile]* 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_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;
  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_reader", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "pyarrow/io.pxi":1031
 *     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":1032
 * 
 *     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(4, 1032, __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(4, 1032, __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":1031
 *     cdef NativeFile nf
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    }

    /* "pyarrow/io.pxi":1040
 *             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":1041
 *     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(4, 1041, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1041, __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(4, 1041, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_n_s_r) < 0) __PYX_ERR(4, 1041, __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(4, 1041, __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":1040
 *             source = PythonFile(source, mode='r')
 *     else:
 *         if use_memory_map:             # <<<<<<<<<<<<<<
 *             source = memory_map(source_path, mode='r')
 *         else:
 */
        goto __pyx_L9;
      }

      /* "pyarrow/io.pxi":1043
 *             source = memory_map(source_path, mode='r')
 *         else:
 *             source = OSFile(source_path, mode='r')             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(source, NativeFile):
 */
      /*else*/ {
        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1043, __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(4, 1043, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_mode, __pyx_n_s_r) < 0) __PYX_ERR(4, 1043, __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(4, 1043, __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_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":1033
 *     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_reader", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(4, 1033, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_8);

      /* "pyarrow/io.pxi":1034
 *         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":1035
 *     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(4, 1035, __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":1034
 *         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":1036
 *         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_s_read); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(4, 1036, __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":1038
 *         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(4, 1038, __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(4, 1038, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_mode, __pyx_n_s_r) < 0) __PYX_ERR(4, 1038, __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(4, 1038, __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":1036
 *         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":1031
 *     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":1045
 *             source = OSFile(source_path, mode='r')
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         nf = source
 * 
 */
  __pyx_t_10 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
  __pyx_t_7 = (__pyx_t_10 != 0);
  if (likely(__pyx_t_7)) {

    /* "pyarrow/io.pxi":1046
 * 
 *     if isinstance(source, NativeFile):
 *         nf = source             # <<<<<<<<<<<<<<
 * 
 *         # TODO: what about read-write sources (e.g. memory maps)
 */
    if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(4, 1046, __pyx_L1_error)
    __pyx_t_8 = __pyx_v_source;
    __Pyx_INCREF(__pyx_t_8);
    __pyx_v_nf = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "pyarrow/io.pxi":1049
 * 
 *         # TODO: what about read-write sources (e.g. memory maps)
 *         if not nf.is_readable:             # <<<<<<<<<<<<<<
 *             raise IOError('Native file is not readable')
 * 
 */
    __pyx_t_7 = ((!(__pyx_v_nf->is_readable != 0)) != 0);
    if (unlikely(__pyx_t_7)) {

      /* "pyarrow/io.pxi":1050
 *         # TODO: what about read-write sources (e.g. memory maps)
 *         if not nf.is_readable:
 *             raise IOError('Native file is not readable')             # <<<<<<<<<<<<<<
 * 
 *         nf.read_handle(reader)
 */
      __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__142, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1050, __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, 1050, __pyx_L1_error)

      /* "pyarrow/io.pxi":1049
 * 
 *         # TODO: what about read-write sources (e.g. memory maps)
 *         if not nf.is_readable:             # <<<<<<<<<<<<<<
 *             raise IOError('Native file is not readable')
 * 
 */
    }

    /* "pyarrow/io.pxi":1052
 *             raise IOError('Native file is not readable')
 * 
 *         nf.read_handle(reader)             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_nf->__pyx_vtab)->read_handle(__pyx_v_nf, __pyx_v_reader); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1052, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "pyarrow/io.pxi":1045
 *             source = OSFile(source_path, mode='r')
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         nf = source
 * 
 */
    goto __pyx_L15;
  }

  /* "pyarrow/io.pxi":1054
 *         nf.read_handle(reader)
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'             # <<<<<<<<<<<<<<
 *                         .format(type(source)))
 * 
 */
  /*else*/ {

    /* "pyarrow/io.pxi":1055
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'
 *                         .format(type(source)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unable_to_read_from_object_of_ty, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1055, __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_8 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, ((PyObject *)Py_TYPE(__pyx_v_source))) : __Pyx_PyObject_CallOneArg(__pyx_t_6, ((PyObject *)Py_TYPE(__pyx_v_source)));
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "pyarrow/io.pxi":1054
 *         nf.read_handle(reader)
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'             # <<<<<<<<<<<<<<
 *                         .format(type(source)))
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1054, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_Raise(__pyx_t_6, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __PYX_ERR(4, 1054, __pyx_L1_error)
  }
  __pyx_L15:;

  /* "pyarrow/io.pxi":1027
 * 
 * 
 * cdef get_reader(object source, c_bool use_memory_map,             # <<<<<<<<<<<<<<
 *                 shared_ptr[RandomAccessFile]* 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_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_reader", __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":1058
 * 
 * 
 * cdef get_writer(object source, shared_ptr[OutputStream]* 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;
  __Pyx_RefNannySetupContext("get_writer", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "pyarrow/io.pxi":1061
 *     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":1062
 * 
 *     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(4, 1062, __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(4, 1062, __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":1061
 *     cdef NativeFile nf
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         source_path = _stringify_path(source)
 *     except TypeError:
 */
    }

    /* "pyarrow/io.pxi":1068
 *             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(4, 1068, __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(4, 1068, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_mode, __pyx_n_s_w) < 0) __PYX_ERR(4, 1068, __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(4, 1068, __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_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":1063
 *     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(4, 1063, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_4);

      /* "pyarrow/io.pxi":1064
 *         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_s_write); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(4, 1064, __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":1066
 *         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(4, 1066, __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(4, 1066, __pyx_L5_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_mode, __pyx_n_s_w) < 0) __PYX_ERR(4, 1066, __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(4, 1066, __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":1064
 *         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":1061
 *     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":1070
 *         source = OSFile(source_path, mode='w')
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         nf = source
 * 
 */
  __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":1071
 * 
 *     if isinstance(source, NativeFile):
 *         nf = source             # <<<<<<<<<<<<<<
 * 
 *         if not nf.is_writable:
 */
    if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(4, 1071, __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":1073
 *         nf = source
 * 
 *         if not nf.is_writable:             # <<<<<<<<<<<<<<
 *             raise IOError('Native file is not writable')
 * 
 */
    __pyx_t_9 = ((!(__pyx_v_nf->is_writable != 0)) != 0);
    if (unlikely(__pyx_t_9)) {

      /* "pyarrow/io.pxi":1074
 * 
 *         if not nf.is_writable:
 *             raise IOError('Native file is not writable')             # <<<<<<<<<<<<<<
 * 
 *         nf.write_handle(writer)
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IOError, __pyx_tuple__143, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1074, __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, 1074, __pyx_L1_error)

      /* "pyarrow/io.pxi":1073
 *         nf = source
 * 
 *         if not nf.is_writable:             # <<<<<<<<<<<<<<
 *             raise IOError('Native file is not writable')
 * 
 */
    }

    /* "pyarrow/io.pxi":1076
 *             raise IOError('Native file is not writable')
 * 
 *         nf.write_handle(writer)             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'
 */
    __pyx_t_4 = ((struct __pyx_vtabstruct_7pyarrow_3lib_NativeFile *)__pyx_v_nf->__pyx_vtab)->write_handle(__pyx_v_nf, __pyx_v_writer); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":1070
 *         source = OSFile(source_path, mode='w')
 * 
 *     if isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         nf = source
 * 
 */
    goto __pyx_L14;
  }

  /* "pyarrow/io.pxi":1078
 *         nf.write_handle(writer)
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'             # <<<<<<<<<<<<<<
 *                         .format(type(source)))
 * 
 */
  /*else*/ {

    /* "pyarrow/io.pxi":1079
 *     else:
 *         raise TypeError('Unable to read from object of type: {0}'
 *                         .format(type(source)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unable_to_read_from_object_of_ty, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1079, __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(4, 1079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1078
 *         nf.write_handle(writer)
 *     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(4, 1078, __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(4, 1078, __pyx_L1_error)
  }
  __pyx_L14:;

  /* "pyarrow/io.pxi":1058
 * 
 * 
 * cdef get_writer(object source, shared_ptr[OutputStream]* 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":1084
 * # ---------------------------------------------------------------------
 * 
 * cdef CompressionType _get_compression_type(object name):             # <<<<<<<<<<<<<<
 *     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;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("_get_compression_type", 0);

  /* "pyarrow/io.pxi":1085
 * 
 * cdef CompressionType _get_compression_type(object name):
 *     if name is None or name == 'uncompressed':             # <<<<<<<<<<<<<<
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'snappy':
 */
  __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_PyString_Equals(__pyx_v_name, __pyx_n_s_uncompressed, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(4, 1085, __pyx_L1_error)
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1086
 * cdef CompressionType _get_compression_type(object name):
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED             # <<<<<<<<<<<<<<
 *     elif name == 'snappy':
 *         return CompressionType_SNAPPY
 */
    __pyx_r =  arrow::Compression::UNCOMPRESSED;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1085
 * 
 * cdef CompressionType _get_compression_type(object name):
 *     if name is None or name == 'uncompressed':             # <<<<<<<<<<<<<<
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'snappy':
 */
  }

  /* "pyarrow/io.pxi":1087
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'snappy':             # <<<<<<<<<<<<<<
 *         return CompressionType_SNAPPY
 *     elif name == 'gzip':
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_snappy, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1087, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1088
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'snappy':
 *         return CompressionType_SNAPPY             # <<<<<<<<<<<<<<
 *     elif name == 'gzip':
 *         return CompressionType_GZIP
 */
    __pyx_r =  arrow::Compression::SNAPPY;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1087
 *     if name is None or name == 'uncompressed':
 *         return CompressionType_UNCOMPRESSED
 *     elif name == 'snappy':             # <<<<<<<<<<<<<<
 *         return CompressionType_SNAPPY
 *     elif name == 'gzip':
 */
  }

  /* "pyarrow/io.pxi":1089
 *     elif name == 'snappy':
 *         return CompressionType_SNAPPY
 *     elif name == 'gzip':             # <<<<<<<<<<<<<<
 *         return CompressionType_GZIP
 *     elif name == 'brotli':
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_gzip, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1089, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1090
 *         return CompressionType_SNAPPY
 *     elif name == 'gzip':
 *         return CompressionType_GZIP             # <<<<<<<<<<<<<<
 *     elif name == 'brotli':
 *         return CompressionType_BROTLI
 */
    __pyx_r =  arrow::Compression::GZIP;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1089
 *     elif name == 'snappy':
 *         return CompressionType_SNAPPY
 *     elif name == 'gzip':             # <<<<<<<<<<<<<<
 *         return CompressionType_GZIP
 *     elif name == 'brotli':
 */
  }

  /* "pyarrow/io.pxi":1091
 *     elif name == 'gzip':
 *         return CompressionType_GZIP
 *     elif name == 'brotli':             # <<<<<<<<<<<<<<
 *         return CompressionType_BROTLI
 *     elif name == 'zstd':
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_brotli, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1091, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1092
 *         return CompressionType_GZIP
 *     elif name == 'brotli':
 *         return CompressionType_BROTLI             # <<<<<<<<<<<<<<
 *     elif name == 'zstd':
 *         return CompressionType_ZSTD
 */
    __pyx_r =  arrow::Compression::BROTLI;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1091
 *     elif name == 'gzip':
 *         return CompressionType_GZIP
 *     elif name == 'brotli':             # <<<<<<<<<<<<<<
 *         return CompressionType_BROTLI
 *     elif name == 'zstd':
 */
  }

  /* "pyarrow/io.pxi":1093
 *     elif name == 'brotli':
 *         return CompressionType_BROTLI
 *     elif name == 'zstd':             # <<<<<<<<<<<<<<
 *         return CompressionType_ZSTD
 *     elif name == 'lz4':
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_zstd, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1093, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/io.pxi":1094
 *         return CompressionType_BROTLI
 *     elif name == 'zstd':
 *         return CompressionType_ZSTD             # <<<<<<<<<<<<<<
 *     elif name == 'lz4':
 *         return CompressionType_LZ4
 */
    __pyx_r =  arrow::Compression::ZSTD;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1093
 *     elif name == 'brotli':
 *         return CompressionType_BROTLI
 *     elif name == 'zstd':             # <<<<<<<<<<<<<<
 *         return CompressionType_ZSTD
 *     elif name == 'lz4':
 */
  }

  /* "pyarrow/io.pxi":1095
 *     elif name == 'zstd':
 *         return CompressionType_ZSTD
 *     elif name == 'lz4':             # <<<<<<<<<<<<<<
 *         return CompressionType_LZ4
 *     else:
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_name, __pyx_n_s_lz4, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 1095, __pyx_L1_error)
  if (likely(__pyx_t_1)) {

    /* "pyarrow/io.pxi":1096
 *         return CompressionType_ZSTD
 *     elif name == 'lz4':
 *         return CompressionType_LZ4             # <<<<<<<<<<<<<<
 *     else:
 *         raise ValueError("Unrecognized compression type: {0}"
 */
    __pyx_r =  arrow::Compression::LZ4;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1095
 *     elif name == 'zstd':
 *         return CompressionType_ZSTD
 *     elif name == 'lz4':             # <<<<<<<<<<<<<<
 *         return CompressionType_LZ4
 *     else:
 */
  }

  /* "pyarrow/io.pxi":1098
 *         return CompressionType_LZ4
 *     else:
 *         raise ValueError("Unrecognized compression type: {0}"             # <<<<<<<<<<<<<<
 *                          .format(str(name)))
 * 
 */
  /*else*/ {

    /* "pyarrow/io.pxi":1099
 *     else:
 *         raise ValueError("Unrecognized compression type: {0}"
 *                          .format(str(name)))             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unrecognized_compression_type_0, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1099, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1099, __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_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(4, 1099, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1098
 *         return CompressionType_LZ4
 *     else:
 *         raise ValueError("Unrecognized compression type: {0}"             # <<<<<<<<<<<<<<
 *                          .format(str(name)))
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1098, __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(4, 1098, __pyx_L1_error)
  }

  /* "pyarrow/io.pxi":1084
 * # ---------------------------------------------------------------------
 * 
 * cdef CompressionType _get_compression_type(object name):             # <<<<<<<<<<<<<<
 *     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_XDECREF(__pyx_t_7);
  __Pyx_WriteUnraisable("pyarrow.lib._get_compression_type", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = (enum  arrow::Compression::type) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1102
 * 
 * 
 * def compress(object buf, codec='lz4', asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Compress pyarrow.Buffer or Python object supporting the buffer (memoryview)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_117compress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_116compress[] = "compress(buf, codec='lz4', asbytes=False, memory_pool=None)\n\n    Compress pyarrow.Buffer or Python object supporting the buffer (memoryview)\n    protocol\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_117compress = {"compress", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_117compress, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_116compress};
static PyObject *__pyx_pw_7pyarrow_3lib_117compress(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_s_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(4, 1102, __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(4, 1102, __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_116compress(__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_116compress(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_c_codec;
  std::unique_ptr< arrow::util::Codec>  __pyx_v_compressor;
   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
  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;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("compress", 0);
  __Pyx_INCREF(__pyx_v_buf);

  /* "pyarrow/io.pxi":1123
 *     """
 *     cdef:
 *         CompressionType c_codec = _get_compression_type(codec)             # <<<<<<<<<<<<<<
 *         unique_ptr[CCodec] compressor
 *         cdef CBuffer* c_buf
 */
  __pyx_v_c_codec = __pyx_f_7pyarrow_3lib__get_compression_type(__pyx_v_codec);

  /* "pyarrow/io.pxi":1129
 *         cdef ResizableBuffer out_buf
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(CCodec.Create(c_codec, &compressor))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1130
 * 
 *     with nogil:
 *         check_status(CCodec.Create(c_codec, &compressor))             # <<<<<<<<<<<<<<
 * 
 *     if not isinstance(buf, Buffer):
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status( arrow::util::Codec::Create(__pyx_v_c_codec, (&__pyx_v_compressor))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 1130, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":1129
 *         cdef ResizableBuffer out_buf
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(CCodec.Create(c_codec, &compressor))
 * 
 */
      /*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":1132
 *         check_status(CCodec.Create(c_codec, &compressor))
 * 
 *     if not isinstance(buf, Buffer):             # <<<<<<<<<<<<<<
 *         buf = py_buffer(buf)
 * 
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_buf, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_3) {

    /* "pyarrow/io.pxi":1133
 * 
 *     if not isinstance(buf, Buffer):
 *         buf = py_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 *     c_buf = (<Buffer> buf).buffer.get()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1133, __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_buf) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_buf);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_buf, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":1132
 *         check_status(CCodec.Create(c_codec, &compressor))
 * 
 *     if not isinstance(buf, Buffer):             # <<<<<<<<<<<<<<
 *         buf = py_buffer(buf)
 * 
 */
  }

  /* "pyarrow/io.pxi":1135
 *         buf = py_buffer(buf)
 * 
 *     c_buf = (<Buffer> buf).buffer.get()             # <<<<<<<<<<<<<<
 * 
 *     cdef int64_t max_output_size = (compressor.get()
 */
  __pyx_v_c_buf = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_buf)->buffer.get();

  /* "pyarrow/io.pxi":1138
 * 
 *     cdef int64_t max_output_size = (compressor.get()
 *                                     .MaxCompressedLen(c_buf.size(),             # <<<<<<<<<<<<<<
 *                                                       c_buf.data()))
 *     cdef uint8_t* output_buffer = NULL
 */
  __pyx_v_max_output_size = __pyx_v_compressor.get()->MaxCompressedLen(__pyx_v_c_buf->size(), __pyx_v_c_buf->data());

  /* "pyarrow/io.pxi":1140
 *                                     .MaxCompressedLen(c_buf.size(),
 *                                                       c_buf.data()))
 *     cdef uint8_t* output_buffer = NULL             # <<<<<<<<<<<<<<
 * 
 *     if asbytes:
 */
  __pyx_v_output_buffer = NULL;

  /* "pyarrow/io.pxi":1142
 *     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_3 = __Pyx_PyObject_IsTrue(__pyx_v_asbytes); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(4, 1142, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "pyarrow/io.pxi":1143
 * 
 *     if asbytes:
 *         pyobj = PyBytes_FromStringAndSizeNative(NULL, max_output_size)             # <<<<<<<<<<<<<<
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(<object> pyobj)
 *     else:
 */
    __pyx_t_7 =  PyBytes_FromStringAndSize(NULL, __pyx_v_max_output_size); if (unlikely(__pyx_t_7 == ((PyObject *)NULL))) __PYX_ERR(4, 1143, __pyx_L1_error)
    __pyx_v_pyobj = __pyx_t_7;

    /* "pyarrow/io.pxi":1144
 *     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":1142
 *     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_L7;
  }

  /* "pyarrow/io.pxi":1146
 *         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_4, __pyx_n_s_allocate_buffer); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_int64_t(__pyx_v_max_output_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1146, __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(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_memory_pool, __pyx_v_memory_pool) < 0) __PYX_ERR(4, 1146, __pyx_L1_error)

    /* "pyarrow/io.pxi":1147
 *     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_5, __pyx_n_s_resizable, Py_True) < 0) __PYX_ERR(4, 1146, __pyx_L1_error)

    /* "pyarrow/io.pxi":1146
 *         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_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __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;
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7pyarrow_3lib_ResizableBuffer))))) __PYX_ERR(4, 1146, __pyx_L1_error)
    __pyx_v_out_buf = ((struct __pyx_obj_7pyarrow_3lib_ResizableBuffer *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "pyarrow/io.pxi":1148
 *         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 = 0
 */
    __pyx_v_output_buffer = __pyx_v_out_buf->__pyx_base.buffer.get()->mutable_data();
  }
  __pyx_L7:;

  /* "pyarrow/io.pxi":1150
 *         output_buffer = out_buf.buffer.get().mutable_data()
 * 
 *     cdef int64_t output_length = 0             # <<<<<<<<<<<<<<
 *     with nogil:
 *         check_status(compressor.get()
 */
  __pyx_v_output_length = 0;

  /* "pyarrow/io.pxi":1151
 * 
 *     cdef int64_t output_length = 0
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(compressor.get()
 *                      .Compress(c_buf.size(), c_buf.data(),
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1152
 *     cdef int64_t output_length = 0
 *     with nogil:
 *         check_status(compressor.get()             # <<<<<<<<<<<<<<
 *                      .Compress(c_buf.size(), c_buf.data(),
 *                                max_output_size, output_buffer,
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_compressor.get()->Compress(__pyx_v_c_buf->size(), __pyx_v_c_buf->data(), __pyx_v_max_output_size, __pyx_v_output_buffer, (&__pyx_v_output_length))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 1152, __pyx_L9_error)
      }

      /* "pyarrow/io.pxi":1151
 * 
 *     cdef int64_t output_length = 0
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(compressor.get()
 *                      .Compress(c_buf.size(), c_buf.data(),
 */
      /*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":1157
 *                                &output_length))
 * 
 *     if asbytes:             # <<<<<<<<<<<<<<
 *         cp._PyBytes_Resize(&pyobj, <Py_ssize_t> output_length)
 *         return PyObject_to_object(pyobj)
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_asbytes); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(4, 1157, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "pyarrow/io.pxi":1158
 * 
 *     if asbytes:
 *         cp._PyBytes_Resize(&pyobj, <Py_ssize_t> output_length)             # <<<<<<<<<<<<<<
 *         return PyObject_to_object(pyobj)
 *     else:
 */
    __pyx_t_1 = _PyBytes_Resize((&__pyx_v_pyobj), ((Py_ssize_t)__pyx_v_output_length)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 1158, __pyx_L1_error)

    /* "pyarrow/io.pxi":1159
 *     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_8 = __pyx_f_7pyarrow_8includes_6common_PyObject_to_object(__pyx_v_pyobj); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;

    /* "pyarrow/io.pxi":1157
 *                                &output_length))
 * 
 *     if asbytes:             # <<<<<<<<<<<<<<
 *         cp._PyBytes_Resize(&pyobj, <Py_ssize_t> output_length)
 *         return PyObject_to_object(pyobj)
 */
  }

  /* "pyarrow/io.pxi":1161
 *         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(4, 1161, __pyx_L1_error) }
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_out_buf), __pyx_n_s_resize); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyInt_From_int64_t(__pyx_v_output_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(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_8 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __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_8)) __PYX_ERR(4, 1161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "pyarrow/io.pxi":1162
 *     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(4, 1162, __pyx_L1_error) }
    __Pyx_INCREF(((PyObject *)__pyx_v_out_buf));
    __pyx_r = ((PyObject *)__pyx_v_out_buf);
    goto __pyx_L0;
  }

  /* "pyarrow/io.pxi":1102
 * 
 * 
 * def compress(object buf, codec='lz4', asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Compress pyarrow.Buffer or Python object supporting the buffer (memoryview)
 */

  /* 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_AddTraceback("pyarrow.lib.compress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out_buf);
  __Pyx_XDECREF(__pyx_v_buf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/io.pxi":1165
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, memory_pool=None):
 *     """
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_119decompress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_118decompress[] = "decompress(buf, decompressed_size=None, codec='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_119decompress = {"decompress", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_119decompress, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_118decompress};
static PyObject *__pyx_pw_7pyarrow_3lib_119decompress(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_s_lz4);

    /* "pyarrow/io.pxi":1166
 * 
 * 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(4, 1165, __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(4, 1165, __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_118decompress(__pyx_self, __pyx_v_buf, __pyx_v_decompressed_size, __pyx_v_codec, __pyx_v_asbytes, __pyx_v_memory_pool);

  /* "pyarrow/io.pxi":1165
 * 
 * 
 * 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_118decompress(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_c_codec;
  std::unique_ptr< arrow::util::Codec>  __pyx_v_compressor;
   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
  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;
  int64_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("decompress", 0);
  __Pyx_INCREF(__pyx_v_buf);

  /* "pyarrow/io.pxi":1189
 *     """
 *     cdef:
 *         CompressionType c_codec = _get_compression_type(codec)             # <<<<<<<<<<<<<<
 *         unique_ptr[CCodec] compressor
 *         cdef CBuffer* c_buf
 */
  __pyx_v_c_codec = __pyx_f_7pyarrow_3lib__get_compression_type(__pyx_v_codec);

  /* "pyarrow/io.pxi":1194
 *         cdef Buffer out_buf
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(CCodec.Create(c_codec, &compressor))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1195
 * 
 *     with nogil:
 *         check_status(CCodec.Create(c_codec, &compressor))             # <<<<<<<<<<<<<<
 * 
 *     if not isinstance(buf, Buffer):
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status( arrow::util::Codec::Create(__pyx_v_c_codec, (&__pyx_v_compressor))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 1195, __pyx_L4_error)
      }

      /* "pyarrow/io.pxi":1194
 *         cdef Buffer out_buf
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(CCodec.Create(c_codec, &compressor))
 * 
 */
      /*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":1197
 *         check_status(CCodec.Create(c_codec, &compressor))
 * 
 *     if not isinstance(buf, Buffer):             # <<<<<<<<<<<<<<
 *         buf = py_buffer(buf)
 * 
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_buf, __pyx_ptype_7pyarrow_3lib_Buffer); 
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_3) {

    /* "pyarrow/io.pxi":1198
 * 
 *     if not isinstance(buf, Buffer):
 *         buf = py_buffer(buf)             # <<<<<<<<<<<<<<
 * 
 *     c_buf = (<Buffer> buf).buffer.get()
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_py_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1198, __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_buf) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_buf);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_buf, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyarrow/io.pxi":1197
 *         check_status(CCodec.Create(c_codec, &compressor))
 * 
 *     if not isinstance(buf, Buffer):             # <<<<<<<<<<<<<<
 *         buf = py_buffer(buf)
 * 
 */
  }

  /* "pyarrow/io.pxi":1200
 *         buf = py_buffer(buf)
 * 
 *     c_buf = (<Buffer> buf).buffer.get()             # <<<<<<<<<<<<<<
 * 
 *     if decompressed_size is None:
 */
  __pyx_v_c_buf = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_v_buf)->buffer.get();

  /* "pyarrow/io.pxi":1202
 *     c_buf = (<Buffer> buf).buffer.get()
 * 
 *     if decompressed_size is None:             # <<<<<<<<<<<<<<
 *         raise ValueError("Must pass decompressed_size for {0} codec"
 *                          .format(codec))
 */
  __pyx_t_3 = (__pyx_v_decompressed_size == Py_None);
  __pyx_t_2 = (__pyx_t_3 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pyarrow/io.pxi":1204
 *     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_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Must_pass_decompressed_size_for, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1204, __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_codec) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_codec);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1203
 * 
 *     if decompressed_size is None:
 *         raise ValueError("Must pass decompressed_size for {0} codec"             # <<<<<<<<<<<<<<
 *                          .format(codec))
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1203, __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(4, 1203, __pyx_L1_error)

    /* "pyarrow/io.pxi":1202
 *     c_buf = (<Buffer> buf).buffer.get()
 * 
 *     if decompressed_size is None:             # <<<<<<<<<<<<<<
 *         raise ValueError("Must pass decompressed_size for {0} codec"
 *                          .format(codec))
 */
  }

  /* "pyarrow/io.pxi":1206
 *                          .format(codec))
 * 
 *     cdef int64_t output_size = decompressed_size             # <<<<<<<<<<<<<<
 *     cdef uint8_t* output_buffer = NULL
 * 
 */
  __pyx_t_7 = __Pyx_PyInt_As_int64_t(__pyx_v_decompressed_size); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(4, 1206, __pyx_L1_error)
  __pyx_v_output_size = __pyx_t_7;

  /* "pyarrow/io.pxi":1207
 * 
 *     cdef int64_t output_size = decompressed_size
 *     cdef uint8_t* output_buffer = NULL             # <<<<<<<<<<<<<<
 * 
 *     if asbytes:
 */
  __pyx_v_output_buffer = NULL;

  /* "pyarrow/io.pxi":1209
 *     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_2 = __Pyx_PyObject_IsTrue(__pyx_v_asbytes); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 1209, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "pyarrow/io.pxi":1210
 * 
 *     if asbytes:
 *         pybuf = cp.PyBytes_FromStringAndSize(NULL, output_size)             # <<<<<<<<<<<<<<
 *         output_buffer = <uint8_t*> cp.PyBytes_AS_STRING(pybuf)
 *     else:
 */
    __pyx_t_5 = PyBytes_FromStringAndSize(NULL, __pyx_v_output_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_pybuf = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "pyarrow/io.pxi":1211
 *     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":1209
 *     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_L8;
  }

  /* "pyarrow/io.pxi":1213
 *         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_5, __pyx_n_s_allocate_buffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyInt_From_int64_t(__pyx_v_output_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_memory_pool, __pyx_v_memory_pool) < 0) __PYX_ERR(4, 1213, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 1213, __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_4); __pyx_t_4 = 0;
    if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_7pyarrow_3lib_Buffer))))) __PYX_ERR(4, 1213, __pyx_L1_error)
    __pyx_v_out_buf = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_8);
    __pyx_t_8 = 0;

    /* "pyarrow/io.pxi":1214
 *     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_L8:;

  /* "pyarrow/io.pxi":1216
 *         output_buffer = out_buf.buffer.get().mutable_data()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(compressor.get()
 *                      .Decompress(c_buf.size(), c_buf.data(),
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/io.pxi":1217
 * 
 *     with nogil:
 *         check_status(compressor.get()             # <<<<<<<<<<<<<<
 *                      .Decompress(c_buf.size(), c_buf.data(),
 *                                  output_size, output_buffer))
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_compressor.get()->Decompress(__pyx_v_c_buf->size(), __pyx_v_c_buf->data(), __pyx_v_output_size, __pyx_v_output_buffer)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 1217, __pyx_L10_error)
      }

      /* "pyarrow/io.pxi":1216
 *         output_buffer = out_buf.buffer.get().mutable_data()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(compressor.get()
 *                      .Decompress(c_buf.size(), c_buf.data(),
 */
      /*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/io.pxi":1221
 *                                  output_size, output_buffer))
 * 
 *     return pybuf if asbytes else out_buf             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_asbytes); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 1221, __pyx_L1_error)
  if (__pyx_t_2) {
    if (unlikely(!__pyx_v_pybuf)) { __Pyx_RaiseUnboundLocalError("pybuf"); __PYX_ERR(4, 1221, __pyx_L1_error) }
    __Pyx_INCREF(__pyx_v_pybuf);
    __pyx_t_8 = __pyx_v_pybuf;
  } else {
    if (unlikely(!__pyx_v_out_buf)) { __Pyx_RaiseUnboundLocalError("out_buf"); __PYX_ERR(4, 1221, __pyx_L1_error) }
    __Pyx_INCREF(((PyObject *)__pyx_v_out_buf));
    __pyx_t_8 = ((PyObject *)__pyx_v_out_buf);
  }
  __pyx_r = __pyx_t_8;
  __pyx_t_8 = 0;
  goto __pyx_L0;

  /* "pyarrow/io.pxi":1165
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, memory_pool=None):
 *     """
 */

  /* 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_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_XDECREF(__pyx_v_buf);
  __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_121have_libhdfs(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_120have_libhdfs[] = "have_libhdfs()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_121have_libhdfs = {"have_libhdfs", (PyCFunction)__pyx_pw_7pyarrow_3lib_121have_libhdfs, METH_NOARGS, __pyx_doc_7pyarrow_3lib_120have_libhdfs};
static PyObject *__pyx_pw_7pyarrow_3lib_121have_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_120have_libhdfs(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_120have_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(12, 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(12, 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_123have_libhdfs3(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_122have_libhdfs3[] = "have_libhdfs3()";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_123have_libhdfs3 = {"have_libhdfs3", (PyCFunction)__pyx_pw_7pyarrow_3lib_123have_libhdfs3, METH_NOARGS, __pyx_doc_7pyarrow_3lib_122have_libhdfs3};
static PyObject *__pyx_pw_7pyarrow_3lib_123have_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_122have_libhdfs3(__pyx_self);

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

static PyObject *__pyx_pf_7pyarrow_3lib_122have_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(12, 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(12, 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_125strip_hdfs_abspath(PyObject *__pyx_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_7pyarrow_3lib_124strip_hdfs_abspath[] = "strip_hdfs_abspath(path)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_125strip_hdfs_abspath = {"strip_hdfs_abspath", (PyCFunction)__pyx_pw_7pyarrow_3lib_125strip_hdfs_abspath, METH_O, __pyx_doc_7pyarrow_3lib_124strip_hdfs_abspath};
static PyObject *__pyx_pw_7pyarrow_3lib_125strip_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_124strip_hdfs_abspath(__pyx_self, ((PyObject *)__pyx_v_path));

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

static PyObject *__pyx_pf_7pyarrow_3lib_124strip_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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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_8genexpr2__pyx_v_k = NULL;
  PyObject *__pyx_8genexpr2__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;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  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(12, 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(12, 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(12, 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
 */
  if (!(likely(PyString_CheckExact(__pyx_v_host))||((__pyx_v_host) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_host)->tp_name), 0))) __PYX_ERR(12, 74, __pyx_L1_error)
  __pyx_t_3 = __pyx_v_host;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->host);
  __Pyx_DECREF(__pyx_v_self->host);
  __pyx_v_self->host = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "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(12, 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(12, 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(12, 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(12, 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(12, 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:
 */
  if (!(likely(PyString_CheckExact(__pyx_v_user))||((__pyx_v_user) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_user)->tp_name), 0))) __PYX_ERR(12, 81, __pyx_L1_error)
  __pyx_t_3 = __pyx_v_user;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->user);
  __Pyx_DECREF(__pyx_v_self->user);
  __pyx_v_self->user = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "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(12, 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(12, 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(12, 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':
 */
  if (!(likely(PyString_CheckExact(__pyx_v_kerb_ticket))||((__pyx_v_kerb_ticket) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_kerb_ticket)->tp_name), 0))) __PYX_ERR(12, 85, __pyx_L1_error)
  __pyx_t_3 = __pyx_v_kerb_ticket;
  __Pyx_INCREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __Pyx_GOTREF(__pyx_v_self->kerb_ticket);
  __Pyx_DECREF(__pyx_v_self->kerb_ticket);
  __pyx_v_self->kerb_ticket = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/io-hdfs.pxi":87
 *         self.kerb_ticket = kerb_ticket
 * 
 *         if driver == 'libhdfs':             # <<<<<<<<<<<<<<
 *             with nogil:
 *                 check_status(HaveLibHdfs())
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_driver, __pyx_n_s_libhdfs, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(12, 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(12, 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_PyString_Equals(__pyx_v_driver, __pyx_n_s_libhdfs3, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(12, 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(12, 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_PyString_FormatSafe(__pyx_kp_s_unknown_driver_r, __pyx_v_driver); if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 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(12, 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(12, 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):
 */
  if (!(likely(PyString_CheckExact(__pyx_v_driver))||((__pyx_v_driver) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_driver)->tp_name), 0))) __PYX_ERR(12, 97, __pyx_L1_error)
  __pyx_t_4 = __pyx_v_driver;
  __Pyx_INCREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_self->driver);
  __Pyx_DECREF(__pyx_v_self->driver);
  __pyx_v_self->driver = ((PyObject*)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "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(12, 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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_extra_conf, __pyx_n_s_items); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 101, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = NULL;
      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_3 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 101, __pyx_L18_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
        __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(12, 101, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(12, 101, __pyx_L18_error)
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      for (;;) {
        if (likely(!__pyx_t_11)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_10 >= 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_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(12, 101, __pyx_L18_error)
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 101, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          } else {
            if (__pyx_t_10 >= 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_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(12, 101, __pyx_L18_error)
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 101, __pyx_L18_error)
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          }
        } else {
          __pyx_t_3 = __pyx_t_11(__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(12, 101, __pyx_L18_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_3);
        }
        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(12, 101, __pyx_L18_error)
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          if (likely(PyTuple_CheckExact(sequence))) {
            __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
            __pyx_t_12 = PyTuple_GET_ITEM(sequence, 1); 
          } else {
            __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
            __pyx_t_12 = PyList_GET_ITEM(sequence, 1); 
          }
          __Pyx_INCREF(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_12);
          #else
          __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 101, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(12, 101, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_12);
          #endif
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        } else {
          Py_ssize_t index = -1;
          __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(12, 101, __pyx_L18_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
          index = 0; __pyx_t_9 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_9)) goto __pyx_L21_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_9);
          index = 1; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L21_unpacking_failed;
          __Pyx_GOTREF(__pyx_t_12);
          if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) __PYX_ERR(12, 101, __pyx_L18_error)
          __pyx_t_14 = NULL;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          goto __pyx_L22_unpacking_done;
          __pyx_L21_unpacking_failed:;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_14 = NULL;
          if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
          __PYX_ERR(12, 101, __pyx_L18_error)
          __pyx_L22_unpacking_done:;
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_k, __pyx_t_9);
        __pyx_t_9 = 0;
        __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_v, __pyx_t_12);
        __pyx_t_12 = 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_12, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_12)) __PYX_ERR(12, 100, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_9 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_3 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_9, __pyx_8genexpr2__pyx_v_k) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_8genexpr2__pyx_v_k);
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(12, 100, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 100, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_9);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_9, function);
          }
        }
        __pyx_t_12 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_13, __pyx_8genexpr2__pyx_v_v) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_8genexpr2__pyx_v_v);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(12, 100, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_t_3, (PyObject*)__pyx_t_12))) __PYX_ERR(12, 100, __pyx_L18_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

        /* "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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_k); __pyx_8genexpr2__pyx_v_k = 0;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_v); __pyx_8genexpr2__pyx_v_v = 0;
      goto __pyx_L23_exit_scope;
      __pyx_L18_error:;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_k); __pyx_8genexpr2__pyx_v_k = 0;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_v); __pyx_8genexpr2__pyx_v_v = 0;
      goto __pyx_L1_error;
      __pyx_L23_exit_scope:;
    } /* exit inner scope */

    /* "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_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(12, 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(12, 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(CHadoopFileSystem.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(CHadoopFileSystem.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(12, 105, __pyx_L25_error)
      }

      /* "pyarrow/io-hdfs.pxi":104
 *         self.extra_conf = extra_conf
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(CHadoopFileSystem.Connect(&conf, &self.client))
 *         self.is_open = True
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L26;
        }
        __pyx_L25_error: {
          #ifdef WITH_THREAD
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L1_error;
        }
        __pyx_L26:;
      }
  }

  /* "pyarrow/io-hdfs.pxi":106
 *         with nogil:
 *             check_status(CHadoopFileSystem.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_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("pyarrow.lib.HadoopFileSystem._connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_k);
  __Pyx_XDECREF(__pyx_8genexpr2__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(12, 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(12, 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(12, 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(12, 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(12, 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__144, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 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(12, 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__145, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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_s_path, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 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(12, 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(12, 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_s_owner, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 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(12, 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(12, 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_s_group, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_size, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_block_size, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_last_modified, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_last_accessed, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_replication, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_permissions, __pyx_t_2) < 0) __PYX_ERR(12, 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_s_directory);
    __pyx_t_2 = __pyx_n_s_directory;
  } else {
    __Pyx_INCREF(__pyx_n_s_file);
    __pyx_t_2 = __pyx_n_s_file;
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_kind, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_size, __pyx_t_2) < 0) __PYX_ERR(12, 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_s_directory);
    __pyx_t_2 = __pyx_n_s_directory;
  } else {
    __Pyx_INCREF(__pyx_n_s_file);
    __pyx_t_2 = __pyx_n_s_file;
  }
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_kind, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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_s_file);
        __pyx_t_1 = __pyx_n_s_file;
      } else {
        __Pyx_INCREF(__pyx_n_s_directory);
        __pyx_t_1 = __pyx_n_s_directory;
      }
      __Pyx_XDECREF_SET(__pyx_v_kind, __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(12, 287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_kind, __pyx_v_kind) < 0) __PYX_ERR(12, 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_s_name_2, __pyx_v_name) < 0) __PYX_ERR(12, 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(12, 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(12, 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(12, 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_s_owner, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 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(12, 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(12, 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_s_group, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_last_modified_time, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_last_access_time, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_size, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 294, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_replication, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_block_size, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 296, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_permissions, __pyx_t_2) < 0) __PYX_ERR(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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='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_s_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(12, 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(12, 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(12, 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(12, 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_PyString_Equals(__pyx_t_1, __pyx_n_s_rb_2, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(12, 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_PyString_Equals(__pyx_t_1, __pyx_n_s_wb, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(12, 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_PyString_Equals(__pyx_t_1, __pyx_n_s_ab, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(12, 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__146, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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(12, 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_PyString_Equals(__pyx_t_1, __pyx_n_s_wb, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(12, 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_PyString_Equals(__pyx_t_1, __pyx_n_s_ab, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(12, 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_PyString_Equals(__pyx_v_mode, __pyx_n_s_ab, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(12, 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(12, 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.wr_file = <shared_ptr[OutputStream]> wr_handle             # <<<<<<<<<<<<<<
 *             out.is_writable = True
 *         else:
 */
    __pyx_v_out->__pyx_base.wr_file = ((std::shared_ptr<arrow::io::OutputStream> )__pyx_v_wr_handle);

    /* "pyarrow/io-hdfs.pxi":428
 * 
 *             out.wr_file = <shared_ptr[OutputStream]> 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(12, 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.rd_file = <shared_ptr[RandomAccessFile]> rd_handle             # <<<<<<<<<<<<<<
 *             out.is_readable = True
 * 
 */
    __pyx_v_out->__pyx_base.rd_file = ((std::shared_ptr<arrow::io::RandomAccessFile> )__pyx_v_rd_handle);

    /* "pyarrow/io-hdfs.pxi":435
 * 
 *             out.rd_file = <shared_ptr[RandomAccessFile]> rd_handle
 *             out.is_readable = True             # <<<<<<<<<<<<<<
 * 
 *         if c_buffer_size == 0:
 */
    __pyx_v_out->__pyx_base.is_readable = 1;
  }
  __pyx_L13:;

  /* "pyarrow/io-hdfs.pxi":437
 *             out.is_readable = True
 * 
 *         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":438
 * 
 *         if c_buffer_size == 0:
 *             c_buffer_size = 2 ** 16             # <<<<<<<<<<<<<<
 * 
 *         out.mode = mode
 */
    __pyx_v_c_buffer_size = 0x10000;

    /* "pyarrow/io-hdfs.pxi":437
 *             out.is_readable = True
 * 
 *         if c_buffer_size == 0:             # <<<<<<<<<<<<<<
 *             c_buffer_size = 2 ** 16
 * 
 */
  }

  /* "pyarrow/io-hdfs.pxi":440
 *             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":441
 * 
 *         out.mode = mode
 *         out.buffer_size = c_buffer_size             # <<<<<<<<<<<<<<
 *         out.parent = _HdfsFileNanny(self, out)
 *         out.closed = False
 */
  __pyx_v_out->buffer_size = __pyx_v_c_buffer_size;

  /* "pyarrow/io-hdfs.pxi":442
 *         out.mode = mode
 *         out.buffer_size = c_buffer_size
 *         out.parent = _HdfsFileNanny(self, out)             # <<<<<<<<<<<<<<
 *         out.closed = False
 *         out.own_file = True
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 442, __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(12, 442, __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":443
 *         out.buffer_size = c_buffer_size
 *         out.parent = _HdfsFileNanny(self, out)
 *         out.closed = False             # <<<<<<<<<<<<<<
 *         out.own_file = True
 * 
 */
  __pyx_v_out->__pyx_base.closed = 0;

  /* "pyarrow/io-hdfs.pxi":444
 *         out.parent = _HdfsFileNanny(self, out)
 *         out.closed = False
 *         out.own_file = True             # <<<<<<<<<<<<<<
 * 
 *         return out
 */
  __pyx_v_out->__pyx_base.own_file = 1;

  /* "pyarrow/io-hdfs.pxi":446
 *         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":448
 *         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(12, 448, __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(12, 448, __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(12, 448, __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":449
 * 
 *     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(12, 449, __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_s_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(12, 449, __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_s_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(12, 449, __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(12, 449, __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_s_rb_2);
      __Pyx_GIVEREF(__pyx_n_s_rb_2);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_rb_2);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 449, __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(12, 449, __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(12, 449, __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(12, 449, __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":450
 *     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(12, 450, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 450, __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(12, 450, __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(12, 450, __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(12, 450, __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":449
 * 
 *     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_5); __pyx_t_5 = 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;
        /*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(12, 449, __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(12, 449, __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(12, 449, __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(12, 449, __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(12, 449, __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__147, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 449, __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":448
 *         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":452
 *             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(12, 452, __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(12, 452, __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(12, 452, __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":456
 *         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(12, 456, __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_s_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(12, 456, __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_s_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(12, 456, __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(12, 456, __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_s_wb);
      __Pyx_GIVEREF(__pyx_n_s_wb);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_wb);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 456, __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(12, 456, __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(12, 456, __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(12, 456, __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":457
 *         """
 *         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(12, 457, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 457, __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(12, 457, __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(12, 457, __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(12, 457, __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":456
 *         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_5); __pyx_t_5 = 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;
        /*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(12, 456, __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(12, 456, __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(12, 456, __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(12, 456, __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(12, 456, __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__147, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(12, 456, __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":452
 *             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             # <<<<<<<<<<<<<<
 *         str host
 *         str 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(12, 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
 *         str host             # <<<<<<<<<<<<<<
 *         str user
 *         str 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
 *         str host
 *         str user             # <<<<<<<<<<<<<<
 *         str kerb_ticket
 *         str 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
 *         str host
 *         str user
 *         str kerb_ticket             # <<<<<<<<<<<<<<
 *         str 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
 *         str user
 *         str kerb_ticket
 *         str 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
 *         str kerb_ticket
 *         str 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(12, 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
 *         str 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__148, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__149, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":469
 *         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(12, 469, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(12, 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_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(12, 469, __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":470
 * 
 *     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, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(12, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_weakref = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/io-hdfs.pxi":471
 *     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":472
 *         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(12, 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_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(12, 472, __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":469
 *         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":474
 *         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":475
 * 
 *     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(12, 475, __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":476
 *     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(12, 476, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "pyarrow/io-hdfs.pxi":477
 *         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(12, 477, __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(12, 477, __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":476
 *     def __dealloc__(self):
 *         fh = self.file_handle_ref()
 *         if fh:             # <<<<<<<<<<<<<<
 *             fh.close()
 *         # avoid cyclic GC
 */
  }

  /* "pyarrow/io-hdfs.pxi":479
 *             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":480
 *         # 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":474
 *         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__150, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__151, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":489
 *         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":490
 * 
 *     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":489
 *         object parent
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.parent = None
 */

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

/* "pyarrow/io-hdfs.pxi":485
 * 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(12, 485, __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":486
 *     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":487
 *         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__152, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__153, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":22
 *     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":25
 *         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":28
 *         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_s_Do_not_call_s_constructor_direct_6, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 28, __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, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 28, __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, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/ipc.pxi":26
 * 
 *     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(5, 26, __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, 26, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":25
 *         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":31
 * 
 *     @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":32
 *     @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(5, 32, __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(5, 32, __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(5, 32, __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":31
 * 
 *     @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":35
 * 
 *     @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":36
 *     @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(5, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":35
 * 
 *     @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":39
 * 
 *     @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":40
 *     @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":41
 *     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":42
 *         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":41
 *     def body(self):
 *         cdef shared_ptr[CBuffer] body = self.message.get().body()
 *         if body.get() == NULL:             # <<<<<<<<<<<<<<
 *             return None
 *         else:
 */
  }

  /* "pyarrow/ipc.pxi":44
 *             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(5, 44, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "pyarrow/ipc.pxi":39
 * 
 *     @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":46
 *             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(5, 46, __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":59
 *         """
 *         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":60
 *         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":59
 *         """
 *         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":61
 *         with nogil:
 *             result = self.message.get().Equals(deref(other.message.get()))
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def serialize(self, 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(5, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":46
 *             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":63
 *         return result
 * 
 *     def serialize(self, alignment=8, memory_pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write message as encapsulated IPC message
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_7serialize(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_7Message_6serialize[] = "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_7serialize(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(5, 63, __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(5, 63, __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_6serialize(((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_6serialize(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 = 0;
  int64_t __pyx_v_output_length;
  int32_t __pyx_v_c_alignment;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int32_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("serialize", 0);

  /* "pyarrow/ipc.pxi":79
 *         """
 *         cdef:
 *             BufferOutputStream stream = BufferOutputStream(memory_pool)             # <<<<<<<<<<<<<<
 *             int64_t output_length = 0
 *             int32_t c_alignment = alignment
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferOutputStream), __pyx_v_memory_pool); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 79, __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":80
 *         cdef:
 *             BufferOutputStream stream = BufferOutputStream(memory_pool)
 *             int64_t output_length = 0             # <<<<<<<<<<<<<<
 *             int32_t c_alignment = alignment
 * 
 */
  __pyx_v_output_length = 0;

  /* "pyarrow/ipc.pxi":81
 *             BufferOutputStream stream = BufferOutputStream(memory_pool)
 *             int64_t output_length = 0
 *             int32_t c_alignment = alignment             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_2 = __Pyx_PyInt_As_int32_t(__pyx_v_alignment); if (unlikely((__pyx_t_2 == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 81, __pyx_L1_error)
  __pyx_v_c_alignment = __pyx_t_2;

  /* "pyarrow/ipc.pxi":83
 *             int32_t c_alignment = alignment
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.message.get()
 *                          .SerializeTo(stream.wr_file.get(), c_alignment,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":84
 * 
 *         with nogil:
 *             check_status(self.message.get()             # <<<<<<<<<<<<<<
 *                          .SerializeTo(stream.wr_file.get(), c_alignment,
 *                                       &output_length))
 */
        __pyx_t_3 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->message.get()->SerializeTo(__pyx_v_stream->__pyx_base.wr_file.get(), __pyx_v_c_alignment, (&__pyx_v_output_length))); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 84, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":83
 *             int32_t c_alignment = alignment
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.message.get()
 *                          .SerializeTo(stream.wr_file.get(), c_alignment,
 */
      /*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":87
 *                          .SerializeTo(stream.wr_file.get(), c_alignment,
 *                                       &output_length))
 *         return stream.getvalue()             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_stream), __pyx_n_s_getvalue); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 87, __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_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, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":63
 *         return result
 * 
 *     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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":89
 *         return stream.getvalue()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         metadata_len = self.metadata.size
 *         body = self.body
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_9__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_9__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_7Message_8__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_8__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
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  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("__repr__", 0);

  /* "pyarrow/ipc.pxi":90
 * 
 *     def __repr__(self):
 *         metadata_len = self.metadata.size             # <<<<<<<<<<<<<<
 *         body = self.body
 *         body_len = 0 if body is None else body.size
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_metadata); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_metadata_len = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/ipc.pxi":91
 *     def __repr__(self):
 *         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_body); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_body = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/ipc.pxi":92
 *         metadata_len = self.metadata.size
 *         body = self.body
 *         body_len = 0 if body is None else body.size             # <<<<<<<<<<<<<<
 * 
 *         return """pyarrow.Message
 */
  __pyx_t_3 = (__pyx_v_body == Py_None);
  if ((__pyx_t_3 != 0)) {
    __Pyx_INCREF(__pyx_int_0);
    __pyx_t_2 = __pyx_int_0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_body, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_v_body_len = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/ipc.pxi":94
 *         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":97
 * type: {0}
 * metadata length: {1}
 * body length: {2}""".format(self.type, metadata_len, body_len)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_pyarrow_Message_type_0_metadata, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 97, __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_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 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_4, __pyx_v_metadata_len, __pyx_v_body_len};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 97, __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;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_4, __pyx_v_metadata_len, __pyx_v_body_len};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 97, __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;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 97, __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_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 97, __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_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":89
 *         return stream.getvalue()
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         metadata_len = self.metadata.size
 *         body = self.body
 */

  /* 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_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_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_7Message_10__reduce_cython__[] = "Message.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_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_7Message_10__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_10__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__154, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_7Message_12__setstate_cython__[] = "Message.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_7Message_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_7Message_12__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_12__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__155, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":108
 *         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":111
 *         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":114
 *         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_s_Do_not_call_s_constructor_direct_7, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 114, __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, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 114, __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, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/ipc.pxi":112
 * 
 *     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(5, 112, __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, 112, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":111
 *         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":117
 * 
 *     @staticmethod
 *     def open_stream(source):             # <<<<<<<<<<<<<<
 *         cdef MessageReader result = MessageReader.__new__(MessageReader)
 *         cdef shared_ptr[InputStream] in_stream
 */

/* 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(5, 117, __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(5, 117, __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":118
 *     @staticmethod
 *     def open_stream(source):
 *         cdef MessageReader result = MessageReader.__new__(MessageReader)             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[InputStream] in_stream
 *         cdef 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(5, 118, __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":121
 *         cdef shared_ptr[InputStream] in_stream
 *         cdef 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(5, 121, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":122
 *         cdef unique_ptr[CMessageReader] reader
 *         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":123
 *         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":124
 *         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":122
 *         cdef unique_ptr[CMessageReader] reader
 *         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":126
 *             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":117
 * 
 *     @staticmethod
 *     def open_stream(source):             # <<<<<<<<<<<<<<
 *         cdef MessageReader result = MessageReader.__new__(MessageReader)
 *         cdef shared_ptr[InputStream] in_stream
 */

  /* 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_8generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/ipc.pxi":128
 *         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_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(5, 128, __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_8generator8, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_MessageReader___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(5, 128, __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_8generator8(__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;
  __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, 128, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":129
 * 
 *     def __iter__(self):
 *         while True:             # <<<<<<<<<<<<<<
 *             yield self.read_next_message()
 * 
 */
  while (1) {

    /* "pyarrow/ipc.pxi":130
 *     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(5, 130, __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, 130, __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(5, 130, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/ipc.pxi":128
 *         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":132
 *             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":137
 *         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(5, 137, __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":139
 *         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":140
 * 
 *         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(5, 140, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":139
 *         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":142
 *             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":143
 * 
 *         if result.message.get() == NULL:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(5, 143, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":142
 *             check_status(self.reader.get().ReadNextMessage(&result.message))
 * 
 *         if result.message.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 * 
 */
  }

  /* "pyarrow/ipc.pxi":145
 *             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":132
 *             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__156, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__157, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":156
 *         bint closed
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.closed = True
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_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_18_RecordBatchWriter___cinit__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_3lib_18_RecordBatchWriter___cinit__(struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyarrow/ipc.pxi":157
 * 
 *     def __cinit__(self):
 *         self.closed = True             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->closed = 1;

  /* "pyarrow/ipc.pxi":156
 *         bint closed
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.closed = True
 * 
 */

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

/* "pyarrow/ipc.pxi":159
 *         self.closed = True
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static void __pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7pyarrow_3lib_18_RecordBatchWriter_2__dealloc__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *)__pyx_v_self));

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

static void __pyx_pf_7pyarrow_3lib_18_RecordBatchWriter_2__dealloc__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

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

/* "pyarrow/ipc.pxi":162
 *         pass
 * 
 *     def _open(self, sink, Schema schema):             # <<<<<<<<<<<<<<
 *         get_writer(sink, &self.sink)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_5_open(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_RecordBatchWriter_4_open[] = "_RecordBatchWriter._open(self, sink, Schema schema)";
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_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_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sink,&__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_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", 1, 2, 2, 1); __PYX_ERR(5, 162, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_open") < 0)) __PYX_ERR(5, 162, __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_sink = 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("_open", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 162, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchWriter._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(5, 162, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_18_RecordBatchWriter_4_open(((struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *)__pyx_v_self), __pyx_v_sink, __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_18_RecordBatchWriter_4_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__pyx_v_self, PyObject *__pyx_v_sink, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_open", 0);

  /* "pyarrow/ipc.pxi":163
 * 
 *     def _open(self, sink, Schema schema):
 *         get_writer(sink, &self.sink)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_get_writer(__pyx_v_sink, (&__pyx_v_self->sink)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":165
 *         get_writer(sink, &self.sink)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 CRecordBatchStreamWriter.Open(self.sink.get(),
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":166
 * 
 *         with nogil:
 *             check_status(             # <<<<<<<<<<<<<<
 *                 CRecordBatchStreamWriter.Open(self.sink.get(),
 *                                               schema.sp_schema,
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status( arrow::ipc::RecordBatchStreamWriter::Open(__pyx_v_self->sink.get(), __pyx_v_schema->sp_schema, (&__pyx_v_self->writer))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 166, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":165
 *         get_writer(sink, &self.sink)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 CRecordBatchStreamWriter.Open(self.sink.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":170
 *                                               schema.sp_schema,
 *                                               &self.writer))
 *         self.closed = False             # <<<<<<<<<<<<<<
 * 
 *     def write(self, table_or_batch):
 */
  __pyx_v_self->closed = 0;

  /* "pyarrow/ipc.pxi":162
 *         pass
 * 
 *     def _open(self, sink, Schema schema):             # <<<<<<<<<<<<<<
 *         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_1);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchWriter._open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":172
 *         self.closed = False
 * 
 *     def write(self, table_or_batch):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch or Table to stream
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_7write(PyObject *__pyx_v_self, PyObject *__pyx_v_table_or_batch); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_RecordBatchWriter_6write[] = "_RecordBatchWriter.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_18_RecordBatchWriter_7write(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_18_RecordBatchWriter_6write(((struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *)__pyx_v_self), ((PyObject *)__pyx_v_table_or_batch));

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

static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchWriter_6write(struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__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":180
 *         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":181
 *         """
 *         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(5, 181, __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(5, 181, __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":180
 *         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":182
 *         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":183
 *             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(5, 183, __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(5, 183, __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":182
 *         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":185
 *             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(5, 185, __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(5, 185, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "pyarrow/ipc.pxi":172
 *         self.closed = False
 * 
 *     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._RecordBatchWriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":187
 *             raise ValueError(type(table_or_batch))
 * 
 *     def write_batch(self, RecordBatch batch):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch to stream
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_9write_batch(PyObject *__pyx_v_self, PyObject *__pyx_v_batch); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_RecordBatchWriter_8write_batch[] = "_RecordBatchWriter.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_18_RecordBatchWriter_9write_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(5, 187, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_18_RecordBatchWriter_8write_batch(((struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *)__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_18_RecordBatchWriter_8write_batch(struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__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":195
 *         batch : RecordBatch
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get()
 *                          .WriteRecordBatch(deref(batch.batch), 1))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":196
 *         """
 *         with nogil:
 *             check_status(self.writer.get()             # <<<<<<<<<<<<<<
 *                          .WriteRecordBatch(deref(batch.batch), 1))
 * 
 */
        __pyx_t_1 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->writer.get()->WriteRecordBatch((*__pyx_v_batch->batch), 1)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 196, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":195
 *         batch : RecordBatch
 *         """
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get()
 *                          .WriteRecordBatch(deref(batch.batch), 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/ipc.pxi":187
 *             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._RecordBatchWriter.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":199
 *                          .WriteRecordBatch(deref(batch.batch), 1))
 * 
 *     def write_table(self, Table table, chunksize=None):             # <<<<<<<<<<<<<<
 *         """
 *         Write RecordBatch to stream
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_11write_table(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_RecordBatchWriter_10write_table[] = "_RecordBatchWriter.write_table(self, Table table, chunksize=None)\n\n        Write RecordBatch to stream\n\n        Parameters\n        ----------\n        batch : RecordBatch\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_11write_table(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table = 0;
  PyObject *__pyx_v_chunksize = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_table (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_table,&__pyx_n_s_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_chunksize);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_table") < 0)) __PYX_ERR(5, 199, __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_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(5, 199, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchWriter.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(5, 199, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_18_RecordBatchWriter_10write_table(((struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *)__pyx_v_self), __pyx_v_table, __pyx_v_chunksize);

  /* 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_18_RecordBatchWriter_10write_table(struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__pyx_v_self, struct __pyx_obj_7pyarrow_3lib_Table *__pyx_v_table, PyObject *__pyx_v_chunksize) {
  int64_t __pyx_v_c_chunksize;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int64_t __pyx_t_3;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("write_table", 0);

  /* "pyarrow/ipc.pxi":209
 *         cdef:
 *             # Chunksize must be > 0 to have any impact
 *             int64_t c_chunksize = -1             # <<<<<<<<<<<<<<
 * 
 *         if chunksize is not None:
 */
  __pyx_v_c_chunksize = -1L;

  /* "pyarrow/ipc.pxi":211
 *             int64_t c_chunksize = -1
 * 
 *         if chunksize is not None:             # <<<<<<<<<<<<<<
 *             c_chunksize = chunksize
 * 
 */
  __pyx_t_1 = (__pyx_v_chunksize != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/ipc.pxi":212
 * 
 *         if chunksize is not None:
 *             c_chunksize = chunksize             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __pyx_t_3 = __Pyx_PyInt_As_int64_t(__pyx_v_chunksize); if (unlikely((__pyx_t_3 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(5, 212, __pyx_L1_error)
    __pyx_v_c_chunksize = __pyx_t_3;

    /* "pyarrow/ipc.pxi":211
 *             int64_t c_chunksize = -1
 * 
 *         if chunksize is not None:             # <<<<<<<<<<<<<<
 *             c_chunksize = chunksize
 * 
 */
  }

  /* "pyarrow/ipc.pxi":214
 *             c_chunksize = chunksize
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().WriteTable(table.table[0],
 *                                                       c_chunksize))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":215
 * 
 *         with nogil:
 *             check_status(self.writer.get().WriteTable(table.table[0],             # <<<<<<<<<<<<<<
 *                                                       c_chunksize))
 * 
 */
        __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->writer.get()->WriteTable((__pyx_v_table->table[0]), __pyx_v_c_chunksize)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 215, __pyx_L5_error)
      }

      /* "pyarrow/ipc.pxi":214
 *             c_chunksize = chunksize
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().WriteTable(table.table[0],
 *                                                       c_chunksize))
 */
      /*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/ipc.pxi":199
 *                          .WriteRecordBatch(deref(batch.batch), 1))
 * 
 *     def write_table(self, Table table, chunksize=None):             # <<<<<<<<<<<<<<
 *         """
 *         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._RecordBatchWriter.write_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":218
 *                                                       c_chunksize))
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Close stream and write end-of-stream 0 marker
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_13close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_RecordBatchWriter_12close[] = "_RecordBatchWriter.close(self)\n\n        Close stream and write end-of-stream 0 marker\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_13close(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_18_RecordBatchWriter_12close(((struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchWriter_12close(struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("close", 0);

  /* "pyarrow/ipc.pxi":222
 *         Close stream and write end-of-stream 0 marker
 *         """
 *         if self.closed:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  __pyx_t_1 = (__pyx_v_self->closed != 0);
  if (__pyx_t_1) {

    /* "pyarrow/ipc.pxi":223
 *         """
 *         if self.closed:
 *             return             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pyarrow/ipc.pxi":222
 *         Close stream and write end-of-stream 0 marker
 *         """
 *         if self.closed:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
  }

  /* "pyarrow/ipc.pxi":225
 *             return
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().Close())
 *         self.closed = True
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":226
 * 
 *         with nogil:
 *             check_status(self.writer.get().Close())             # <<<<<<<<<<<<<<
 *         self.closed = True
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->writer.get()->Close()); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 226, __pyx_L5_error)
      }

      /* "pyarrow/ipc.pxi":225
 *             return
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.writer.get().Close())
 *         self.closed = True
 */
      /*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/ipc.pxi":227
 *         with nogil:
 *             check_status(self.writer.get().Close())
 *         self.closed = True             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->closed = 1;

  /* "pyarrow/ipc.pxi":218
 *                                                       c_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._RecordBatchWriter.close", __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_18_RecordBatchWriter_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_RecordBatchWriter_14__reduce_cython__[] = "_RecordBatchWriter.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_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_18_RecordBatchWriter_14__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchWriter_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__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__158, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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._RecordBatchWriter.__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_18_RecordBatchWriter_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_RecordBatchWriter_16__setstate_cython__[] = "_RecordBatchWriter.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_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_18_RecordBatchWriter_16__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchWriter_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *__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__159, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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._RecordBatchWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":230
 * 
 * 
 * cdef get_input_stream(object source, shared_ptr[InputStream]* out):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[RandomAccessFile] file_handle
 */

static PyObject *__pyx_f_7pyarrow_3lib_get_input_stream(PyObject *__pyx_v_source, std::shared_ptr<arrow::io::InputStream>  *__pyx_v_out) {
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_v_file_handle;
  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":234
 *         shared_ptr[RandomAccessFile] file_handle
 * 
 *     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":235
 * 
 *     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(5, 235, __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(5, 235, __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":234
 *         shared_ptr[RandomAccessFile] file_handle
 * 
 *     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_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/ipc.pxi":236
 *     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":234
 *         shared_ptr[RandomAccessFile] file_handle
 * 
 *     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":240
 *         pass
 * 
 *     get_reader(source, True, &file_handle)             # <<<<<<<<<<<<<<
 *     out[0] = <shared_ptr[InputStream]> file_handle
 * 
 */
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_get_reader(__pyx_v_source, 1, (&__pyx_v_file_handle)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/ipc.pxi":241
 * 
 *     get_reader(source, True, &file_handle)
 *     out[0] = <shared_ptr[InputStream]> file_handle             # <<<<<<<<<<<<<<
 * 
 * 
 */
  (__pyx_v_out[0]) = ((std::shared_ptr<arrow::io::InputStream> )__pyx_v_file_handle);

  /* "pyarrow/ipc.pxi":230
 * 
 * 
 * cdef get_input_stream(object source, shared_ptr[InputStream]* out):             # <<<<<<<<<<<<<<
 *     cdef:
 *         shared_ptr[RandomAccessFile] file_handle
 */

  /* 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;
}

/* "pyarrow/ipc.pxi":252
 *         Schema schema
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_7pyarrow_3lib_18_RecordBatchReader_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7pyarrow_3lib_18_RecordBatchReader_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_18_RecordBatchReader___cinit__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *)__pyx_v_self));

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

static int __pyx_pf_7pyarrow_3lib_18_RecordBatchReader___cinit__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__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":255
 *         pass
 * 
 *     def _open(self, source):             # <<<<<<<<<<<<<<
 *         get_input_stream(source, &self.in_stream)
 *         with nogil:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchReader_3_open(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_RecordBatchReader_2_open[] = "_RecordBatchReader._open(self, source)";
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchReader_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_18_RecordBatchReader_2_open(((struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *)__pyx_v_self), ((PyObject *)__pyx_v_source));

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

static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchReader_2_open(struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__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":256
 * 
 *     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(5, 256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":257
 *     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":258
 *         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->reader))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 258, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":257
 *     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":261
 *                 self.in_stream.get(), &self.reader))
 * 
 *         self.schema = pyarrow_wrap_schema(self.reader.get().schema())             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_schema(__pyx_v_self->reader.get()->schema()); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 261, __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(5, 261, __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":255
 *         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._RecordBatchReader._open", __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_18_RecordBatchReader_6generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/ipc.pxi":263
 *         self.schema = pyarrow_wrap_schema(self.reader.get().schema())
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.read_next_batch()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchReader_5__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchReader_5__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18_RecordBatchReader_4__iter__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchReader_4__iter__(struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__pyx_v_self) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11___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_11___iter__ *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_11___iter__(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_11___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(5, 263, __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_18_RecordBatchReader_6generator9, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_RecordBatchReader___iter, __pyx_n_s_pyarrow_lib); if (unlikely(!gen)) __PYX_ERR(5, 263, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchReader.__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_18_RecordBatchReader_6generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11___iter__ *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11___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(5, 263, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":264
 * 
 *     def __iter__(self):
 *         while True:             # <<<<<<<<<<<<<<
 *             yield self.read_next_batch()
 * 
 */
  while (1) {

    /* "pyarrow/ipc.pxi":265
 *     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(5, 265, __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, 265, __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(5, 265, __pyx_L1_error)
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "pyarrow/ipc.pxi":263
 *         self.schema = pyarrow_wrap_schema(self.reader.get().schema())
 * 
 *     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":267
 *             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_18_RecordBatchReader_8get_next_batch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_RecordBatchReader_7get_next_batch[] = "_RecordBatchReader.get_next_batch(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchReader_8get_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_18_RecordBatchReader_7get_next_batch(((struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchReader_7get_next_batch(struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__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":268
 * 
 *     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, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_warnings = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":269
 *     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(5, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "pyarrow/ipc.pxi":270
 *         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__160, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 269, __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":271
 *         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(5, 271, __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(5, 271, __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":267
 *             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._RecordBatchReader.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":273
 *         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_18_RecordBatchReader_10read_next_batch(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_RecordBatchReader_9read_next_batch[] = "_RecordBatchReader.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_18_RecordBatchReader_10read_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_18_RecordBatchReader_9read_next_batch(((struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchReader_9read_next_batch(struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__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":280
 *         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":281
 * 
 *         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(5, 281, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":280
 *         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":283
 *             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":284
 * 
 *         if batch.get() == NULL:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *         return pyarrow_wrap_batch(batch)
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(5, 284, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":283
 *             check_status(self.reader.get().ReadNext(&batch))
 * 
 *         if batch.get() == NULL:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 * 
 */
  }

  /* "pyarrow/ipc.pxi":286
 *             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(5, 286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":273
 *         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._RecordBatchReader.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":288
 *         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_18_RecordBatchReader_12read_all(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_RecordBatchReader_11read_all[] = "_RecordBatchReader.read_all(self)\n\n        Read all record batches as a pyarrow.Table\n        ";
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchReader_12read_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_18_RecordBatchReader_11read_all(((struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchReader_11read_all(struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__pyx_v_self) {
  std::vector<std::shared_ptr< arrow::RecordBatch> >  __pyx_v_batches;
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_batch;
  std::shared_ptr< arrow::Table>  __pyx_v_table;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("read_all", 0);

  /* "pyarrow/ipc.pxi":297
 *             shared_ptr[CTable] table
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             while True:
 *                 check_status(self.reader.get().ReadNext(&batch))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":298
 * 
 *         with nogil:
 *             while True:             # <<<<<<<<<<<<<<
 *                 check_status(self.reader.get().ReadNext(&batch))
 *                 if batch.get() == NULL:
 */
        while (1) {

          /* "pyarrow/ipc.pxi":299
 *         with nogil:
 *             while True:
 *                 check_status(self.reader.get().ReadNext(&batch))             # <<<<<<<<<<<<<<
 *                 if batch.get() == NULL:
 *                     break
 */
          __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(5, 299, __pyx_L4_error)

          /* "pyarrow/ipc.pxi":300
 *             while True:
 *                 check_status(self.reader.get().ReadNext(&batch))
 *                 if batch.get() == NULL:             # <<<<<<<<<<<<<<
 *                     break
 *                 batches.push_back(batch)
 */
          __pyx_t_2 = ((__pyx_v_batch.get() == NULL) != 0);
          if (__pyx_t_2) {

            /* "pyarrow/ipc.pxi":301
 *                 check_status(self.reader.get().ReadNext(&batch))
 *                 if batch.get() == NULL:
 *                     break             # <<<<<<<<<<<<<<
 *                 batches.push_back(batch)
 * 
 */
            goto __pyx_L7_break;

            /* "pyarrow/ipc.pxi":300
 *             while True:
 *                 check_status(self.reader.get().ReadNext(&batch))
 *                 if batch.get() == NULL:             # <<<<<<<<<<<<<<
 *                     break
 *                 batches.push_back(batch)
 */
          }

          /* "pyarrow/ipc.pxi":302
 *                 if batch.get() == NULL:
 *                     break
 *                 batches.push_back(batch)             # <<<<<<<<<<<<<<
 * 
 *             check_status(CTable.FromRecordBatches(self.schema.sp_schema,
 */
          try {
            __pyx_v_batches.push_back(__pyx_v_batch);
          } catch(...) {
            #ifdef WITH_THREAD
            PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
            #endif
            __Pyx_CppExn2PyErr();
            #ifdef WITH_THREAD
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            #endif
            __PYX_ERR(5, 302, __pyx_L4_error)
          }
        }
        __pyx_L7_break:;

        /* "pyarrow/ipc.pxi":304
 *                 batches.push_back(batch)
 * 
 *             check_status(CTable.FromRecordBatches(self.schema.sp_schema,             # <<<<<<<<<<<<<<
 *                                                   batches, &table))
 * 
 */
        __pyx_t_1 = __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_1 == ((int)-1))) __PYX_ERR(5, 304, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":297
 *             shared_ptr[CTable] table
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             while True:
 *                 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":307
 *                                                   batches, &table))
 * 
 *         return pyarrow_wrap_table(table)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_table); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":288
 *         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_3);
  __Pyx_AddTraceback("pyarrow.lib._RecordBatchReader.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":250
 * 
 *     cdef readonly:
 *         Schema schema             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchReader_6schema_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchReader_6schema_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_18_RecordBatchReader_6schema___get__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchReader_6schema___get__(struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__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_18_RecordBatchReader_14__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_RecordBatchReader_13__reduce_cython__[] = "_RecordBatchReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchReader_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_18_RecordBatchReader_13__reduce_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchReader_13__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__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__161, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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._RecordBatchReader.__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_18_RecordBatchReader_16__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_18_RecordBatchReader_15__setstate_cython__[] = "_RecordBatchReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_18_RecordBatchReader_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_18_RecordBatchReader_15__setstate_cython__(((struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_7pyarrow_3lib_18_RecordBatchReader_15__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *__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__162, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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._RecordBatchReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":312
 * cdef class _RecordBatchFileWriter(_RecordBatchWriter):
 * 
 *     def _open(self, sink, Schema schema):             # <<<<<<<<<<<<<<
 *         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)";
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_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_open (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sink,&__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_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", 1, 2, 2, 1); __PYX_ERR(5, 312, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_open") < 0)) __PYX_ERR(5, 312, __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_sink = 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("_open", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 312, __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(5, 312, __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);

  /* 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_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_open", 0);

  /* "pyarrow/ipc.pxi":313
 * 
 *     def _open(self, sink, Schema schema):
 *         get_writer(sink, &self.sink)             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_get_writer(__pyx_v_sink, (&__pyx_v_self->__pyx_base.sink)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/ipc.pxi":315
 *         get_writer(sink, &self.sink)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 CRecordBatchFileWriter.Open(self.sink.get(), schema.sp_schema,
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":316
 * 
 *         with nogil:
 *             check_status(             # <<<<<<<<<<<<<<
 *                 CRecordBatchFileWriter.Open(self.sink.get(), schema.sp_schema,
 *                                             &self.writer))
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status( arrow::ipc::RecordBatchFileWriter::Open(__pyx_v_self->__pyx_base.sink.get(), __pyx_v_schema->sp_schema, (&__pyx_v_self->__pyx_base.writer))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 316, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":315
 *         get_writer(sink, &self.sink)
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(
 *                 CRecordBatchFileWriter.Open(self.sink.get(), schema.sp_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/ipc.pxi":320
 *                                             &self.writer))
 * 
 *         self.closed = False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx_base.closed = 0;

  /* "pyarrow/ipc.pxi":312
 * cdef class _RecordBatchFileWriter(_RecordBatchWriter):
 * 
 *     def _open(self, sink, Schema schema):             # <<<<<<<<<<<<<<
 *         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_1);
  __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__163, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__164, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":331
 *         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":334
 *         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(5, 334, __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(5, 334, __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":335
 * 
 *     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":336
 *     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(5, 336, __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(5, 336, __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":335
 * 
 *     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_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/ipc.pxi":337
 *         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":335
 * 
 *     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":340
 *             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(5, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/ipc.pxi":342
 *         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":343
 * 
 *         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":344
 *         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(5, 344, __pyx_L1_error)
    __pyx_v_offset = __pyx_t_10;

    /* "pyarrow/ipc.pxi":343
 * 
 *         cdef int64_t offset = 0
 *         if footer_offset is not None:             # <<<<<<<<<<<<<<
 *             offset = footer_offset
 * 
 */
  }

  /* "pyarrow/ipc.pxi":346
 *             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":347
 * 
 *         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":348
 *         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(5, 348, __pyx_L11_error)

          /* "pyarrow/ipc.pxi":347
 * 
 *         with nogil:
 *             if offset != 0:             # <<<<<<<<<<<<<<
 *                 check_status(
 *                     CRecordBatchFileReader.Open2(self.file.get(), offset,
 */
          goto __pyx_L13;
        }

        /* "pyarrow/ipc.pxi":352
 *                                                  &self.reader))
 *             else:
 *                 check_status(             # <<<<<<<<<<<<<<
 *                     CRecordBatchFileReader.Open(self.file.get(), &self.reader))
 * 
 */
        /*else*/ {

          /* "pyarrow/ipc.pxi":353
 *             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(5, 352, __pyx_L11_error)
        }
        __pyx_L13:;
      }

      /* "pyarrow/ipc.pxi":346
 *             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":355
 *                     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(5, 355, __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(5, 355, __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":334
 *         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":358
 * 
 *     @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":359
 *     @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(5, 359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":358
 * 
 *     @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":361
 *         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(5, 361, __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":364
 *         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(5, 364, __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(5, 364, __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(5, 364, __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(5, 364, __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":365
 * 
 *         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_s_Batch_number_0_out_of_range, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 365, __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(5, 365, __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(5, 365, __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(5, 365, __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(5, 365, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":364
 *         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":367
 *             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":368
 * 
 *         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(5, 368, __pyx_L7_error)
      }

      /* "pyarrow/ipc.pxi":367
 *             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":370
 *             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(5, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":361
 *         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":376
 *     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":385
 *             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(5, 385, __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(5, 385, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_nbatches = __pyx_t_2;

  /* "pyarrow/ipc.pxi":387
 *         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(5, 387, __pyx_L1_error)
  }

  /* "pyarrow/ipc.pxi":388
 * 
 *         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":389
 *         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":390
 *         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(5, 390, __pyx_L4_error)
        }

        /* "pyarrow/ipc.pxi":391
 *             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(5, 391, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":388
 * 
 *         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":394
 *                                                   batches, &table))
 * 
 *         return pyarrow_wrap_table(table)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_table(__pyx_v_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":376
 *     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":329
 * 
 *     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_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_8__reduce_cython__[] = "_RecordBatchFileReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_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_22_RecordBatchFileReader_8__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_8__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__165, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_10__setstate_cython__[] = "_RecordBatchFileReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_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_22_RecordBatchFileReader_10__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_10__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__166, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":397
 * 
 * 
 * def get_tensor_size(Tensor tensor):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized Tensor including metadata and padding
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_127get_tensor_size(PyObject *__pyx_self, PyObject *__pyx_v_tensor); /*proto*/
static char __pyx_doc_7pyarrow_3lib_126get_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_127get_tensor_size = {"get_tensor_size", (PyCFunction)__pyx_pw_7pyarrow_3lib_127get_tensor_size, METH_O, __pyx_doc_7pyarrow_3lib_126get_tensor_size};
static PyObject *__pyx_pw_7pyarrow_3lib_127get_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(5, 397, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_126get_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_126get_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":402
 *     """
 *     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":403
 *     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(5, 403, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":402
 *     """
 *     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":404
 *     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(5, 404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":397
 * 
 * 
 * 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":407
 * 
 * 
 * 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_129get_record_batch_size(PyObject *__pyx_self, PyObject *__pyx_v_batch); /*proto*/
static char __pyx_doc_7pyarrow_3lib_128get_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_129get_record_batch_size = {"get_record_batch_size", (PyCFunction)__pyx_pw_7pyarrow_3lib_129get_record_batch_size, METH_O, __pyx_doc_7pyarrow_3lib_128get_record_batch_size};
static PyObject *__pyx_pw_7pyarrow_3lib_129get_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(5, 407, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_128get_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_128get_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":412
 *     """
 *     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":413
 *     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(5, 413, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":412
 *     """
 *     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":414
 *     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(5, 414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":407
 * 
 * 
 * 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":417
 * 
 * 
 * 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_131write_tensor(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_130write_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_131write_tensor = {"write_tensor", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_131write_tensor, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_130write_tensor};
static PyObject *__pyx_pw_7pyarrow_3lib_131write_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(5, 417, __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(5, 417, __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(5, 417, __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(5, 417, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dest), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "dest", 0))) __PYX_ERR(5, 417, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_130write_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_130write_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;
  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("write_tensor", 0);

  /* "pyarrow/ipc.pxi":435
 *         int64_t body_length
 * 
 *     dest._assert_writable()             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dest), __pyx_n_s_assert_writable); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 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(5, 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/ipc.pxi":437
 *     dest._assert_writable()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(
 *             WriteTensor(deref(tensor.tp), dest.wr_file.get(),
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":438
 * 
 *     with nogil:
 *         check_status(             # <<<<<<<<<<<<<<
 *             WriteTensor(deref(tensor.tp), dest.wr_file.get(),
 *                         &metadata_length, &body_length))
 */
        __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::WriteTensor((*__pyx_v_tensor->tp), __pyx_v_dest->wr_file.get(), (&__pyx_v_metadata_length), (&__pyx_v_body_length))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 438, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":437
 *     dest._assert_writable()
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(
 *             WriteTensor(deref(tensor.tp), dest.wr_file.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":442
 *                         &metadata_length, &body_length))
 * 
 *     return metadata_length + body_length             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int64_t((__pyx_v_metadata_length + __pyx_v_body_length)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":417
 * 
 * 
 * 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_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":445
 * 
 * 
 * def read_tensor(NativeFile 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_133read_tensor(PyObject *__pyx_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_7pyarrow_3lib_132read_tensor[] = "read_tensor(NativeFile 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_133read_tensor = {"read_tensor", (PyCFunction)__pyx_pw_7pyarrow_3lib_133read_tensor, METH_O, __pyx_doc_7pyarrow_3lib_132read_tensor};
static PyObject *__pyx_pw_7pyarrow_3lib_133read_tensor(PyObject *__pyx_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_tensor (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_7pyarrow_3lib_NativeFile, 1, "source", 0))) __PYX_ERR(5, 445, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_132read_tensor(__pyx_self, ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_v_source));

  /* 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_132read_tensor(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_source) {
  std::shared_ptr< arrow::Tensor>  __pyx_v_sp_tensor;
  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("read_tensor", 0);

  /* "pyarrow/ipc.pxi":463
 *         shared_ptr[CTensor] sp_tensor
 * 
 *     source._assert_readable()             # <<<<<<<<<<<<<<
 *     with nogil:
 *         check_status(ReadTensor(source.rd_file.get(), &sp_tensor))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_source), __pyx_n_s_assert_readable); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 463, __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, 463, __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":464
 * 
 *     source._assert_readable()
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadTensor(source.rd_file.get(), &sp_tensor))
 *     return pyarrow_wrap_tensor(sp_tensor)
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":465
 *     source._assert_readable()
 *     with nogil:
 *         check_status(ReadTensor(source.rd_file.get(), &sp_tensor))             # <<<<<<<<<<<<<<
 *     return pyarrow_wrap_tensor(sp_tensor)
 * 
 */
        __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::ReadTensor(__pyx_v_source->rd_file.get(), (&__pyx_v_sp_tensor))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 465, __pyx_L4_error)
      }

      /* "pyarrow/ipc.pxi":464
 * 
 *     source._assert_readable()
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadTensor(source.rd_file.get(), &sp_tensor))
 *     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":466
 *     with nogil:
 *         check_status(ReadTensor(source.rd_file.get(), &sp_tensor))
 *     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(5, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":445
 * 
 * 
 * def read_tensor(NativeFile 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_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyarrow.lib.read_tensor", __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 read_message(source):             # <<<<<<<<<<<<<<
 *     """
 *     Read length-prefixed message from file or buffer-like object
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_135read_message(PyObject *__pyx_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_7pyarrow_3lib_134read_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_135read_message = {"read_message", (PyCFunction)__pyx_pw_7pyarrow_3lib_135read_message, METH_O, __pyx_doc_7pyarrow_3lib_134read_message};
static PyObject *__pyx_pw_7pyarrow_3lib_135read_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_134read_message(__pyx_self, ((PyObject *)__pyx_v_source));

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

static PyObject *__pyx_pf_7pyarrow_3lib_134read_message(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source) {
  struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_result = 0;
  struct __pyx_obj_7pyarrow_3lib_NativeFile *__pyx_v_cpp_file = 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;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("read_message", 0);
  __Pyx_INCREF(__pyx_v_source);

  /* "pyarrow/ipc.pxi":482
 *     """
 *     cdef:
 *         Message result = Message.__new__(Message)             # <<<<<<<<<<<<<<
 *         NativeFile cpp_file
 * 
 */
  __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(5, 482, __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":485
 *         NativeFile cpp_file
 * 
 *     if not isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         if hasattr(source, 'read'):
 *             source = PythonFile(source)
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_3) {

    /* "pyarrow/ipc.pxi":486
 * 
 *     if not isinstance(source, NativeFile):
 *         if hasattr(source, 'read'):             # <<<<<<<<<<<<<<
 *             source = PythonFile(source)
 *         else:
 */
    __pyx_t_3 = __Pyx_HasAttr(__pyx_v_source, __pyx_n_s_read); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 486, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (__pyx_t_2) {

      /* "pyarrow/ipc.pxi":487
 *     if not isinstance(source, NativeFile):
 *         if hasattr(source, 'read'):
 *             source = PythonFile(source)             # <<<<<<<<<<<<<<
 *         else:
 *             source = BufferReader(source)
 */
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_PythonFile), __pyx_v_source); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 487, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "pyarrow/ipc.pxi":486
 * 
 *     if not isinstance(source, NativeFile):
 *         if hasattr(source, 'read'):             # <<<<<<<<<<<<<<
 *             source = PythonFile(source)
 *         else:
 */
      goto __pyx_L4;
    }

    /* "pyarrow/ipc.pxi":489
 *             source = PythonFile(source)
 *         else:
 *             source = BufferReader(source)             # <<<<<<<<<<<<<<
 * 
 *     if not isinstance(source, NativeFile):
 */
    /*else*/ {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_BufferReader), __pyx_v_source); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 489, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_source, __pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L4:;

    /* "pyarrow/ipc.pxi":485
 *         NativeFile cpp_file
 * 
 *     if not isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         if hasattr(source, 'read'):
 *             source = PythonFile(source)
 */
  }

  /* "pyarrow/ipc.pxi":491
 *             source = BufferReader(source)
 * 
 *     if not isinstance(source, NativeFile):             # <<<<<<<<<<<<<<
 *         raise ValueError('Unable to read message from object with type: {0}'
 *                          .format(type(source)))
 */
  __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile); 
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "pyarrow/ipc.pxi":493
 *     if not isinstance(source, NativeFile):
 *         raise ValueError('Unable to read message from object with type: {0}'
 *                          .format(type(source)))             # <<<<<<<<<<<<<<
 * 
 *     source._assert_readable()
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unable_to_read_message_from_obje, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 493, __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_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_1)) __PYX_ERR(5, 493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyarrow/ipc.pxi":492
 * 
 *     if not isinstance(source, NativeFile):
 *         raise ValueError('Unable to read message from object with type: {0}'             # <<<<<<<<<<<<<<
 *                          .format(type(source)))
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 492, __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(5, 492, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":491
 *             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":495
 *                          .format(type(source)))
 * 
 *     source._assert_readable()             # <<<<<<<<<<<<<<
 * 
 *     cpp_file = source
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_assert_readable); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 495, __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_4 = (__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_4)) __PYX_ERR(5, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/ipc.pxi":497
 *     source._assert_readable()
 * 
 *     cpp_file = source             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  if (!(likely(((__pyx_v_source) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_source, __pyx_ptype_7pyarrow_3lib_NativeFile))))) __PYX_ERR(5, 497, __pyx_L1_error)
  __pyx_t_4 = __pyx_v_source;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_v_cpp_file = ((struct __pyx_obj_7pyarrow_3lib_NativeFile *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pyarrow/ipc.pxi":499
 *     cpp_file = source
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadMessage(cpp_file.rd_file.get(),
 *                                  &result.message))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":500
 * 
 *     with nogil:
 *         check_status(ReadMessage(cpp_file.rd_file.get(),             # <<<<<<<<<<<<<<
 *                                  &result.message))
 * 
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::ReadMessage(__pyx_v_cpp_file->rd_file.get(), (&__pyx_v_result->message))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(5, 500, __pyx_L7_error)
      }

      /* "pyarrow/ipc.pxi":499
 *     cpp_file = source
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadMessage(cpp_file.rd_file.get(),
 *                                  &result.message))
 */
      /*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":503
 *                                  &result.message))
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":469
 * 
 * 
 * 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_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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_cpp_file);
  __Pyx_XDECREF(__pyx_v_source);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/ipc.pxi":506
 * 
 * 
 * def read_schema(obj):             # <<<<<<<<<<<<<<
 *     """
 *     Read Schema from message or buffer
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_137read_schema(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_136read_schema[] = "read_schema(obj)\n\n    Read Schema from message or buffer\n\n    Parameters\n    ----------\n    obj : buffer or Message\n\n    Returns\n    -------\n    schema : Schema\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_137read_schema = {"read_schema", (PyCFunction)__pyx_pw_7pyarrow_3lib_137read_schema, METH_O, __pyx_doc_7pyarrow_3lib_136read_schema};
static PyObject *__pyx_pw_7pyarrow_3lib_137read_schema(PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_schema (wrapper)", 0);
  __pyx_r = __pyx_pf_7pyarrow_3lib_136read_schema(__pyx_self, ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7pyarrow_3lib_136read_schema(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) {
  std::shared_ptr< arrow::Schema>  __pyx_v_result;
  std::shared_ptr<arrow::io::RandomAccessFile>  __pyx_v_cpp_file;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("read_schema", 0);

  /* "pyarrow/ipc.pxi":522
 *         shared_ptr[RandomAccessFile] cpp_file
 * 
 *     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":523
 * 
 *     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(5, 523, __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(5, 523, __pyx_L1_error)

    /* "pyarrow/ipc.pxi":522
 *         shared_ptr[RandomAccessFile] cpp_file
 * 
 *     if isinstance(obj, Message):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError(type(obj))
 * 
 */
  }

  /* "pyarrow/ipc.pxi":525
 *         raise NotImplementedError(type(obj))
 * 
 *     get_reader(obj, True, &cpp_file)             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  __pyx_t_3 = __pyx_f_7pyarrow_3lib_get_reader(__pyx_v_obj, 1, (&__pyx_v_cpp_file)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyarrow/ipc.pxi":527
 *     get_reader(obj, True, &cpp_file)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadSchema(cpp_file.get(), &result))
 * 
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":528
 * 
 *     with nogil:
 *         check_status(ReadSchema(cpp_file.get(), &result))             # <<<<<<<<<<<<<<
 * 
 *     return pyarrow_wrap_schema(result)
 */
        __pyx_t_4 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::ReadSchema(__pyx_v_cpp_file.get(), (&__pyx_v_result))); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 528, __pyx_L5_error)
      }

      /* "pyarrow/ipc.pxi":527
 *     get_reader(obj, True, &cpp_file)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadSchema(cpp_file.get(), &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/ipc.pxi":530
 *         check_status(ReadSchema(cpp_file.get(), &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(5, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":506
 * 
 * 
 * def read_schema(obj):             # <<<<<<<<<<<<<<
 *     """
 *     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":533
 * 
 * 
 * def read_record_batch(obj, Schema schema):             # <<<<<<<<<<<<<<
 *     """
 *     Read RecordBatch from message, given a known schema
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_139read_record_batch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_138read_record_batch[] = "read_record_batch(obj, Schema schema)\n\n    Read RecordBatch from message, given a known schema\n\n    Parameters\n    ----------\n    obj : Message or Buffer-like\n    schema : Schema\n\n    Returns\n    -------\n    batch : RecordBatch\n    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_139read_record_batch = {"read_record_batch", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_139read_record_batch, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_138read_record_batch};
static PyObject *__pyx_pw_7pyarrow_3lib_139read_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;
  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,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_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", 1, 2, 2, 1); __PYX_ERR(5, 533, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "read_record_batch") < 0)) __PYX_ERR(5, 533, __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_obj = 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("read_record_batch", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 533, __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(5, 533, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_138read_record_batch(__pyx_self, __pyx_v_obj, __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_138read_record_batch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj, struct __pyx_obj_7pyarrow_3lib_Schema *__pyx_v_schema) {
  std::shared_ptr< arrow::RecordBatch>  __pyx_v_result;
  struct __pyx_obj_7pyarrow_3lib_Message *__pyx_v_message = 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;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("read_record_batch", 0);

  /* "pyarrow/ipc.pxi":550
 *         Message message
 * 
 *     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":551
 * 
 *     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(5, 551, __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":550
 *         Message message
 * 
 *     if isinstance(obj, Message):             # <<<<<<<<<<<<<<
 *         message = obj
 *     else:
 */
    goto __pyx_L3;
  }

  /* "pyarrow/ipc.pxi":553
 *         message = obj
 *     else:
 *         message = read_message(obj)             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_read_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 553, __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(5, 553, __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(5, 553, __pyx_L1_error)
    __pyx_v_message = ((struct __pyx_obj_7pyarrow_3lib_Message *)__pyx_t_3);
    __pyx_t_3 = 0;
  }
  __pyx_L3:;

  /* "pyarrow/ipc.pxi":555
 *         message = read_message(obj)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadRecordBatch(deref(message.message.get()),
 *                                      schema.sp_schema, &result))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/ipc.pxi":556
 * 
 *     with nogil:
 *         check_status(ReadRecordBatch(deref(message.message.get()),             # <<<<<<<<<<<<<<
 *                                      schema.sp_schema, &result))
 * 
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(arrow::ipc::ReadRecordBatch((*__pyx_v_message->message.get()), __pyx_v_schema->sp_schema, (&__pyx_v_result))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(5, 556, __pyx_L5_error)
      }

      /* "pyarrow/ipc.pxi":555
 *         message = read_message(obj)
 * 
 *     with nogil:             # <<<<<<<<<<<<<<
 *         check_status(ReadRecordBatch(deref(message.message.get()),
 *                                      schema.sp_schema, &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/ipc.pxi":559
 *                                      schema.sp_schema, &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(5, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyarrow/ipc.pxi":533
 * 
 * 
 * def read_record_batch(obj, Schema schema):             # <<<<<<<<<<<<<<
 *     """
 *     Read RecordBatch from message, given a known schema
 */

  /* 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[OutputStream] 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[OutputStream] 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(13, 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(13, 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[OutputStream] 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(13, 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_2,&__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_2)) != 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(13, 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(13, 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(13, 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(13, 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__167, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(13, 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(13, 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(13, 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(13, 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(13, 62, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 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(13, 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(13, 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(13, 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(13, 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(13, 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(13, 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(13, 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(13, 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(13, 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(13, 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__168, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__169, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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[RandomAccessFile] 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(13, 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(13, 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(13, 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[RandomAccessFile] 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(13, 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(13, 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[RandomAccessFile] 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(13, 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(13, 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(13, 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(13, 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(13, 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(13, 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(13, 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::Column>  __pyx_v_sp_column;
  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(13, 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(13, 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(13, 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(13, 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[CColumn] sp_column
 */
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(13, 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(13, 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(13, 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[CColumn] sp_column
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .GetColumn(i, &sp_column))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/feather.pxi":103
 *         cdef shared_ptr[CColumn] sp_column
 *         with nogil:
 *             check_status(self.reader.get()             # <<<<<<<<<<<<<<
 *                          .GetColumn(i, &sp_column))
 * 
 */
        __pyx_t_6 = __pyx_f_7pyarrow_3lib_check_status(__pyx_v_self->reader.get()->GetColumn(__pyx_v_i, (&__pyx_v_sp_column))); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(13, 103, __pyx_L7_error)
      }

      /* "pyarrow/feather.pxi":102
 * 
 *         cdef shared_ptr[CColumn] sp_column
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(self.reader.get()
 *                          .GetColumn(i, &sp_column))
 */
      /*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_column))
 * 
 *         return pyarrow_wrap_column(sp_column)             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_7pyarrow_3lib_pyarrow_wrap_column(__pyx_v_sp_column); if (unlikely(!__pyx_t_4)) __PYX_ERR(13, 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;
}

/* "(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_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_8__reduce_cython__[] = "FeatherReader.__reduce_cython__(self)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_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_13FeatherReader_8__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_8__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__170, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_7pyarrow_3lib_13FeatherReader_10__setstate_cython__[] = "FeatherReader.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_7pyarrow_3lib_13FeatherReader_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_13FeatherReader_10__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_10__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__171, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":23
 * 
 * 
 * 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_141is_named_tuple(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/
static char __pyx_doc_7pyarrow_3lib_140is_named_tuple[] = "is_named_tuple(cls)\nReturn True if cls is a namedtuple and False otherwise.";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_141is_named_tuple = {"is_named_tuple", (PyCFunction)__pyx_pw_7pyarrow_3lib_141is_named_tuple, METH_O, __pyx_doc_7pyarrow_3lib_140is_named_tuple};
static PyObject *__pyx_pw_7pyarrow_3lib_141is_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_140is_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_2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "pyarrow/serialization.pxi":31
 *     if not isinstance(f, tuple):
 *         return False
 *     return all(type(n) == str 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_13_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_13_genexpr *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_13_genexpr(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_13_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(14, 31, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_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_2generator10, 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(14, 31, __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_2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_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;
  int __pyx_t_5;
  int __pyx_t_6;
  __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(14, 31, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_f)) { __Pyx_RaiseClosureNameError("f"); __PYX_ERR(14, 31, __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(14, 31, __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(14, 31, __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(14, 31, __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(14, 31, __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(14, 31, __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(14, 31, __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(14, 31, __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_t_4 = PyObject_RichCompare(((PyObject *)Py_TYPE(__pyx_cur_scope->__pyx_v_n)), ((PyObject *)(&PyString_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 31, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(14, 31, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = ((!__pyx_t_5) != 0);
    if (__pyx_t_6) {
      __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_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":23
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */

static PyObject *__pyx_pf_7pyarrow_3lib_140is_named_tuple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_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_12_is_named_tuple *)__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple(__pyx_ptype_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(14, 23, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "pyarrow/serialization.pxi":25
 * 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(14, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_b = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":26
 *     """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(14, 26, __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(14, 26, __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(14, 26, __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(14, 26, __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":27
 *     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":26
 *     """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":28
 *     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_s_fields_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 28, __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":29
 *         return False
 *     f = getattr(cls, "_fields", None)
 *     if not isinstance(f, tuple):             # <<<<<<<<<<<<<<
 *         return False
 *     return all(type(n) == str 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":30
 *     f = getattr(cls, "_fields", None)
 *     if not isinstance(f, tuple):
 *         return False             # <<<<<<<<<<<<<<
 *     return all(type(n) == str for n in f)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    goto __pyx_L0;

    /* "pyarrow/serialization.pxi":29
 *         return False
 *     f = getattr(cls, "_fields", None)
 *     if not isinstance(f, tuple):             # <<<<<<<<<<<<<<
 *         return False
 *     return all(type(n) == str for n in f)
 */
  }

  /* "pyarrow/serialization.pxi":31
 *     if not isinstance(f, tuple):
 *         return False
 *     return all(type(n) == str 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(14, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 31, __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":23
 * 
 * 
 * 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":35
 * 
 * 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(14, 35, __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(14, 35, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(14, 35, __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(14, 35, __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":36
 * 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(14, 36, __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(14, 36, __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(14, 36, __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(14, 36, __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(14, 36, __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(14, 36, __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":37
 *     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(14, 37, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":35
 * 
 * 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":41
 * 
 * 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(14, 41, __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(14, 41, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(14, 41, __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(14, 41, __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":42
 * 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(14, 42, __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(14, 42, __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(14, 42, __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(14, 42, __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(14, 42, __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(14, 42, __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":43
 *     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(14, 43, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":41
 * 
 * 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":56
 *         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":58
 *     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(14, 58, __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":59
 *         # 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(14, 59, __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":60
 *         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(14, 60, __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":61
 *         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(14, 61, __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":62
 *         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(14, 62, __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":63
 *         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(14, 63, __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(14, 63, __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":64
 *         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(14, 64, __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(14, 64, __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":56
 *         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":66
 *         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(14, 66, __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(14, 66, __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(14, 66, __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":78
 *             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":79
 *         """
 *         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":66
 *         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":81
 *         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":89
 *         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(14, 89, __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":90
 *         """
 *         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(14, 90, __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(14, 90, __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":91
 *         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(14, 91, __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(14, 91, __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":92
 *         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(14, 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(14, 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->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":93
 *         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(14, 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(14, 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->custom_serializers);
  __Pyx_DECREF(__pyx_v_result->custom_serializers);
  __pyx_v_result->custom_serializers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":94
 *         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(14, 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(14, 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->custom_deserializers);
  __Pyx_DECREF(__pyx_v_result->custom_deserializers);
  __pyx_v_result->custom_deserializers = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":95
 *         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":96
 *         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":98
 *         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":81
 *         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":100
 *         return result
 * 
 *     def register_type(self, type_, type_id, pickle=False,             # <<<<<<<<<<<<<<
 *                       custom_serializer=None, custom_deserializer=None):
 *         """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_ : TypeType\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_2,&__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":101
 * 
 *     def register_type(self, type_, type_id, pickle=False,
 *                       custom_serializer=None, custom_deserializer=None):             # <<<<<<<<<<<<<<
 *         """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_2)) != 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(14, 100, __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(14, 100, __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(14, 100, __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":100
 *         return result
 * 
 *     def register_type(self, type_, type_id, pickle=False,             # <<<<<<<<<<<<<<
 *                       custom_serializer=None, custom_deserializer=None):
 *         """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
  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("register_type", 0);

  /* "pyarrow/serialization.pxi":120
 *             deserialize objects of the class in a particular way.
 *         """
 *         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(14, 120, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":121
 *         """
 *         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(14, 121, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":122
 *         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_1 = __Pyx_PyObject_IsTrue(__pyx_v_pickle); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(14, 122, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pyarrow/serialization.pxi":123
 *         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_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->types_to_pickle, __pyx_n_s_add); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 123, __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_type_id) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_type_id);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 123, __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/serialization.pxi":122
 *         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":124
 *         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_1 = (__pyx_v_custom_serializer != Py_None);
  __pyx_t_5 = (__pyx_t_1 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/serialization.pxi":125
 *             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(14, 125, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":126
 *         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(14, 126, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":124
 *         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":100
 *         return result
 * 
 *     def register_type(self, type_, type_id, pickle=False,             # <<<<<<<<<<<<<<
 *                       custom_serializer=None, custom_deserializer=None):
 *         """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_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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":128
 *             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":129
 * 
 *     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":130
 *     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(14, 130, __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(14, 130, __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(14, 130, __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(14, 130, __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(14, 130, __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(14, 130, __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(14, 130, __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(14, 130, __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":131
 *         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(14, 131, __pyx_L1_error)
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "pyarrow/serialization.pxi":132
 *         for type_ in type(obj).__mro__:
 *             if type_ in self.type_to_type_id:
 *                 found = True             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
      __pyx_v_found = 1;

      /* "pyarrow/serialization.pxi":133
 *             if type_ in self.type_to_type_id:
 *                 found = True
 *                 break             # <<<<<<<<<<<<<<
 * 
 *         if not found:
 */
      goto __pyx_L4_break;

      /* "pyarrow/serialization.pxi":131
 *         found = False
 *         for type_ in type(obj).__mro__:
 *             if type_ in self.type_to_type_id:             # <<<<<<<<<<<<<<
 *                 found = True
 *                 break
 */
    }

    /* "pyarrow/serialization.pxi":130
 *     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":135
 *                 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":136
 * 
 *         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(14, 136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "pyarrow/serialization.pxi":138
 *             raise SerializationCallbackError(
 *                 "pyarrow does not know how to "
 *                 "serialize objects of type {}.".format(type(obj)), obj             # <<<<<<<<<<<<<<
 *             )
 * 
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_pyarrow_does_not_know_how_to_ser, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) __PYX_ERR(14, 138, __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(14, 138, __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(14, 136, __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(14, 136, __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(14, 136, __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(14, 136, __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(14, 136, __pyx_L1_error)

    /* "pyarrow/serialization.pxi":135
 *                 break
 * 
 *         if not found:             # <<<<<<<<<<<<<<
 *             raise SerializationCallbackError(
 *                 "pyarrow does not know how to "
 */
  }

  /* "pyarrow/serialization.pxi":142
 * 
 *         # 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(14, 142, __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(14, 142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_type_id = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "pyarrow/serialization.pxi":143
 *         # 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(14, 143, __pyx_L1_error)
  __pyx_t_5 = (__pyx_t_6 != 0);
  if (__pyx_t_5) {

    /* "pyarrow/serialization.pxi":144
 *         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(14, 144, __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(14, 144, __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_s_data, __pyx_t_1) < 0) __PYX_ERR(14, 144, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":145
 *         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_s_pickle, Py_True) < 0) __PYX_ERR(14, 144, __pyx_L1_error)
    __pyx_v_serialized_obj = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "pyarrow/serialization.pxi":143
 *         # 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":146
 *             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(14, 146, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "pyarrow/serialization.pxi":147
 *                               "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(14, 147, __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(14, 147, __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(14, 147, __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_s_data, __pyx_t_1) < 0) __PYX_ERR(14, 147, __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":146
 *             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":149
 *             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(14, 149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(!__pyx_v_type_)) { __Pyx_RaiseUnboundLocalError("type_"); __PYX_ERR(14, 149, __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(14, 149, __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(14, 149, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_6) {

      /* "pyarrow/serialization.pxi":150
 *         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(14, 150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_serialized_obj = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "pyarrow/serialization.pxi":151
 *             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(14, 151, __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(14, 151, __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_s_pa_getnewargs, __pyx_t_2) < 0)) __PYX_ERR(14, 151, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pyarrow/serialization.pxi":149
 *             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":152
 *                 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_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(14, 152, __pyx_L1_error)
    __pyx_t_5 = (__pyx_t_6 != 0);
    if (likely(__pyx_t_5)) {

      /* "pyarrow/serialization.pxi":153
 *                 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(14, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_serialized_obj = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "pyarrow/serialization.pxi":152
 *                 serialized_obj = {}
 *                 serialized_obj["_pa_getnewargs_"] = obj.__getnewargs__()
 *             elif hasattr(obj, "__dict__"):             # <<<<<<<<<<<<<<
 *                 serialized_obj = obj.__dict__
 *             else:
 */
      goto __pyx_L8;
    }

    /* "pyarrow/serialization.pxi":155
 *                 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":156
 *             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_s_We_do_not_know_how_to_serialize, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 156, __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(14, 156, __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":157
 *                 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(14, 157, __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(14, 157, __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(14, 157, __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(14, 157, __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(14, 157, __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(14, 157, __pyx_L1_error)
    }
    __pyx_L8:;
  }
  __pyx_L7:;

  /* "pyarrow/serialization.pxi":158
 *                       "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(14, 158, __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(14, 158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_pytype, __pyx_v_type_id) < 0) __PYX_ERR(14, 158, __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(14, 158, __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":128
 *             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":160
 *         return dict(serialized_obj, **{"_pytype_": type_id})
 * 
 *     def _deserialize_callback(self, serialized_obj):             # <<<<<<<<<<<<<<
 *         type_id = serialized_obj["_pytype_"]
 * 
 */

/* 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":161
 * 
 *     def _deserialize_callback(self, serialized_obj):
 *         type_id = serialized_obj["_pytype_"]             # <<<<<<<<<<<<<<
 * 
 *         if "pickle" in serialized_obj:
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_serialized_obj, __pyx_n_s_pytype); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_type_id = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":163
 *         type_id = serialized_obj["_pytype_"]
 * 
 *         if "pickle" in serialized_obj:             # <<<<<<<<<<<<<<
 *             # The object was pickled, so unpickle it.
 *             obj = self.pickle_deserializer(serialized_obj["data"])
 */
  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_pickle, __pyx_v_serialized_obj, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(14, 163, __pyx_L1_error)
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/serialization.pxi":165
 *         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_s_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 165, __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(14, 165, __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":163
 *         type_id = serialized_obj["_pytype_"]
 * 
 *         if "pickle" in serialized_obj:             # <<<<<<<<<<<<<<
 *             # The object was pickled, so unpickle it.
 *             obj = self.pickle_deserializer(serialized_obj["data"])
 */
    goto __pyx_L3;
  }

  /* "pyarrow/serialization.pxi":167
 *             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 " + str(type_id) + " not registered in " \
 */
  /*else*/ {
    #ifndef CYTHON_WITHOUT_ASSERTIONS
    if (unlikely(!Py_OptimizeFlag)) {
      __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_id, __pyx_v_self->types_to_pickle, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(14, 167, __pyx_L1_error)
      if (unlikely(!(__pyx_t_3 != 0))) {
        PyErr_SetNone(PyExc_AssertionError);
        __PYX_ERR(14, 167, __pyx_L1_error)
      }
    }
    #endif

    /* "pyarrow/serialization.pxi":168
 *         else:
 *             assert type_id not in self.types_to_pickle
 *             if type_id not in self.whitelisted_types:             # <<<<<<<<<<<<<<
 *                 msg = "Type ID " + str(type_id) + " not registered in " \
 *                       "deserialization callback"
 */
    __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_id, __pyx_v_self->whitelisted_types, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(14, 168, __pyx_L1_error)
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "pyarrow/serialization.pxi":169
 *             assert type_id not in self.types_to_pickle
 *             if type_id not in self.whitelisted_types:
 *                 msg = "Type ID " + str(type_id) + " not registered in " \             # <<<<<<<<<<<<<<
 *                       "deserialization callback"
 *                 raise DeserializationCallbackError(msg, type_id)
 */
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_type_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyNumber_Add(__pyx_kp_s_Type_ID, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_kp_s_not_registered_in_deserializati); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 169, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_msg = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "pyarrow/serialization.pxi":171
 *                 msg = "Type ID " + str(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_5, __pyx_n_s_DeserializationCallbackError); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = NULL;
      __pyx_t_7 = 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_7 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_5)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_msg, __pyx_v_type_id};
        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 171, __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_v_type_id};
        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 171, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 171, __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_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 171, __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_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(14, 171, __pyx_L1_error)

      /* "pyarrow/serialization.pxi":168
 *         else:
 *             assert type_id not in self.types_to_pickle
 *             if type_id not in self.whitelisted_types:             # <<<<<<<<<<<<<<
 *                 msg = "Type ID " + str(type_id) + " not registered in " \
 *                       "deserialization callback"
 */
    }

    /* "pyarrow/serialization.pxi":172
 *                       "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_1 = __Pyx_PyObject_GetItem(__pyx_v_self->whitelisted_types, __pyx_v_type_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_type_ = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "pyarrow/serialization.pxi":173
 *                 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_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_type_id, __pyx_v_self->custom_deserializers, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(14, 173, __pyx_L1_error)
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "pyarrow/serialization.pxi":174
 *             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_5 = __Pyx_PyObject_GetItem(__pyx_v_self->custom_deserializers, __pyx_v_type_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "pyarrow/serialization.pxi":175
 *             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_s_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __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_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __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_1)) __PYX_ERR(14, 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":173
 *                 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_L5;
    }

    /* "pyarrow/serialization.pxi":179
 *                 # 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_3 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_pa_getnewargs, __pyx_v_serialized_obj, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(14, 179, __pyx_L1_error)
      __pyx_t_2 = (__pyx_t_3 != 0);
      if (__pyx_t_2) {

        /* "pyarrow/serialization.pxi":180
 *                 # the __dict__ field.
 *                 if "_pa_getnewargs_" in serialized_obj:
 *                     obj = type_.__new__(             # <<<<<<<<<<<<<<
 *                         type_, *serialized_obj["_pa_getnewargs_"])
 *                 else:
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_type_, __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 180, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);

        /* "pyarrow/serialization.pxi":181
 *                 if "_pa_getnewargs_" in serialized_obj:
 *                     obj = type_.__new__(
 *                         type_, *serialized_obj["_pa_getnewargs_"])             # <<<<<<<<<<<<<<
 *                 else:
 *                     obj = type_.__new__(type_)
 */
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 180, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_v_type_);
        __Pyx_GIVEREF(__pyx_v_type_);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_type_);
        __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_serialized_obj, __pyx_n_s_pa_getnewargs); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 181, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);

        /* "pyarrow/serialization.pxi":180
 *                 # 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(14, 180, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(14, 180, __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;
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 180, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_v_obj = __pyx_t_4;
        __pyx_t_4 = 0;

        /* "pyarrow/serialization.pxi":179
 *                 # 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_L6;
      }

      /* "pyarrow/serialization.pxi":183
 *                         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(14, 183, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = NULL;
        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_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_v_type_) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_type_);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 183, __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":184
 *                 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(14, 184, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = NULL;
        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_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_1, __pyx_n_s_pytype) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s_pytype);
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 184, __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":185
 *                     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(14, 185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = NULL;
        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_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_serialized_obj) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_serialized_obj);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(14, 185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_L6:;
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "pyarrow/serialization.pxi":186
 *                     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":160
 *         return dict(serialized_obj, **{"_pytype_": type_id})
 * 
 *     def _deserialize_callback(self, serialized_obj):             # <<<<<<<<<<<<<<
 *         type_id = serialized_obj["_pytype_"]
 * 
 */

  /* 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":188
 *         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":192
 *         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(14, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 192, __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(14, 192, __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(14, 192, __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(14, 192, __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":188
 *         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":194
 *         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(14, 194, __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(14, 194, __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(14, 194, __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":198
 *         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(14, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 198, __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(14, 198, __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(14, 198, __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(14, 198, __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":194
 *         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":200
 *         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":204
 *         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(14, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 204, __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(14, 204, __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(14, 204, __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(14, 204, __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":200
 *         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":206
 *         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":210
 *         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(14, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 210, __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(14, 210, __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(14, 210, __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(14, 210, __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":206
 *         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 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)
 */

/* 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) {
  int __pyx_v_use_setstate;
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_v__dict = 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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     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(8, 3, __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)":4
 *     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(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v__dict = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":5
 *     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)":6
 *     _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(8, 6, __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(8, 6, __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)":7
 *     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)":5
 *     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)":9
 *         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)":10
 *     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)":11
 *         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(8, 11, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 11, __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(8, 11, __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)":10
 *     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)":13
 *         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(8, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(__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(8, 13, __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 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)
 */

  /* 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)":14
 *     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)":15
 *         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(8, 15, __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(8, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":14
 *     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":227
 * 
 *     @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":229
 *     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":230
 *         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(14, 230, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":229
 *     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":232
 *             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(14, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":227
 * 
 *     @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":234
 *         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":239
 *         """
 *         cdef shared_ptr[OutputStream] 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(14, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":240
 *         cdef shared_ptr[OutputStream] stream
 *         get_writer(sink, &stream)
 *         self._write_to(stream.get())             # <<<<<<<<<<<<<<
 * 
 *     cdef _write_to(self, OutputStream* 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(14, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":234
 *         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":242
 *         self._write_to(stream.get())
 * 
 *     cdef _write_to(self, OutputStream* 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":243
 * 
 *     cdef _write_to(self, OutputStream* 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":244
 *     cdef _write_to(self, OutputStream* 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(14, 244, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":243
 * 
 *     cdef _write_to(self, OutputStream* 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":242
 *         self._write_to(stream.get())
 * 
 *     cdef _write_to(self, OutputStream* 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":246
 *             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(14, 246, __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(14, 246, __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(14, 246, __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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("deserialize", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_context);

  /* "pyarrow/serialization.pxi":252
 *         cdef PyObject* result
 * 
 *         if context is None:             # <<<<<<<<<<<<<<
 *             context = _default_serialization_context
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_context) == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "pyarrow/serialization.pxi":253
 * 
 *         if context is None:
 *             context = _default_serialization_context             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_default_serialization_context); if (unlikely(!__pyx_t_3)) __PYX_ERR(14, 253, __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_SerializationContext))))) __PYX_ERR(14, 253, __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":252
 *         cdef PyObject* result
 * 
 *         if context is None:             # <<<<<<<<<<<<<<
 *             context = _default_serialization_context
 * 
 */
  }

  /* "pyarrow/serialization.pxi":255
 *             context = _default_serialization_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":256
 * 
 *         with nogil:
 *             check_status(DeserializeObject(context, self.data,             # <<<<<<<<<<<<<<
 *                                            <PyObject*> self.base, &result))
 * 
 */
        __pyx_t_4 = __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_4 == ((int)-1))) __PYX_ERR(14, 256, __pyx_L5_error)
      }

      /* "pyarrow/serialization.pxi":255
 *             context = _default_serialization_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":261
 *         # 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(14, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(14, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":246
 *             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_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":263
 *         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(14, 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_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(14, 263, __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":267
 *         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(14, 267, __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(14, 267, __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(14, 267, __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(14, 267, __pyx_L1_error)
  __pyx_v_output = ((struct __pyx_obj_7pyarrow_3lib_Buffer *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":268
 *         """
 *         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(14, 268, __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":269
 *         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(14, 269, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(14, 269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_5) {

    /* "pyarrow/serialization.pxi":270
 *         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(14, 270, __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(14, 270, __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":269
 *         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":271
 *         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(14, 271, __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(14, 271, __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":272
 *             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":263
 *         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":275
 * 
 *     @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(14, 275, __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(14, 275, __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_buffers;
  PyObject *__pyx_v_buffers = 0;
  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;
  __Pyx_RefNannySetupContext("from_components", 0);

  /* "pyarrow/serialization.pxi":281
 *         """
 *         cdef:
 *             int num_tensors = components['num_tensors']             # <<<<<<<<<<<<<<
 *             int num_buffers = components['num_buffers']
 *             list buffers = components['data']
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_components, __pyx_n_s_num_tensors); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 281, __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(14, 281, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_tensors = __pyx_t_2;

  /* "pyarrow/serialization.pxi":282
 *         cdef:
 *             int num_tensors = components['num_tensors']
 *             int num_buffers = components['num_buffers']             # <<<<<<<<<<<<<<
 *             list buffers = components['data']
 *             SerializedPyObject result = SerializedPyObject()
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_components, __pyx_n_s_num_buffers); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 282, __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(14, 282, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_num_buffers = __pyx_t_2;

  /* "pyarrow/serialization.pxi":283
 *             int num_tensors = components['num_tensors']
 *             int num_buffers = components['num_buffers']
 *             list buffers = components['data']             # <<<<<<<<<<<<<<
 *             SerializedPyObject result = SerializedPyObject()
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_components, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 283, __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(14, 283, __pyx_L1_error)
  __pyx_v_buffers = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":284
 *             int num_buffers = components['num_buffers']
 *             list buffers = components['data']
 *             SerializedPyObject result = SerializedPyObject()             # <<<<<<<<<<<<<<
 * 
 *         with nogil:
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject)); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 284, __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":286
 *             SerializedPyObject result = SerializedPyObject()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(GetSerializedFromComponents(num_tensors, num_buffers,
 *                                                      buffers, &result.data))
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      #endif
      /*try:*/ {

        /* "pyarrow/serialization.pxi":287
 * 
 *         with nogil:
 *             check_status(GetSerializedFromComponents(num_tensors, num_buffers,             # <<<<<<<<<<<<<<
 *                                                      buffers, &result.data))
 * 
 */
        __pyx_t_2 = __pyx_f_7pyarrow_3lib_check_status(arrow::py::GetSerializedFromComponents(__pyx_v_num_tensors, __pyx_v_num_buffers, __pyx_v_buffers, (&__pyx_v_result->data))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(14, 287, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":286
 *             SerializedPyObject result = SerializedPyObject()
 * 
 *         with nogil:             # <<<<<<<<<<<<<<
 *             check_status(GetSerializedFromComponents(num_tensors, num_buffers,
 *                                                      buffers, &result.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":290
 *                                                      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":275
 * 
 *     @staticmethod
 *     def from_components(components):             # <<<<<<<<<<<<<<
 *         """
 *         Reconstruct SerializedPyObject from output of
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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":292
 *         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(14, 292, __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(14, 292, __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":307
 *         """
 *         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(14, 307, __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":309
 *         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":310
 * 
 *         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(14, 310, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":309
 *         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":312
 *             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(14, 312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pyarrow/serialization.pxi":292
 *         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":224
 * 
 *     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__172, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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__173, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 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(8, 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":315
 * 
 * 
 * def serialize(object value, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_143serialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_142serialize[] = "serialize(value, SerializationContext context=None)\nEXPERIMENTAL: Serialize a Python sequence\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    ";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_143serialize = {"serialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_143serialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_142serialize};
static PyObject *__pyx_pw_7pyarrow_3lib_143serialize(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(14, 315, __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(14, 315, __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(14, 315, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_142serialize(__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_142serialize(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;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("serialize", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_context);

  /* "pyarrow/serialization.pxi":330
 *     serialized : SerializedPyObject
 *     """
 *     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(14, 330, __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":331
 *     """
 *     cdef SerializedPyObject serialized = SerializedPyObject()
 *     wrapped_value = [value]             # <<<<<<<<<<<<<<
 * 
 *     if context is None:
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 331, __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":333
 *     wrapped_value = [value]
 * 
 *     if context is None:             # <<<<<<<<<<<<<<
 *         context = _default_serialization_context
 * 
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_context) == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "pyarrow/serialization.pxi":334
 * 
 *     if context is None:
 *         context = _default_serialization_context             # <<<<<<<<<<<<<<
 * 
 *     with nogil:
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_default_serialization_context); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 334, __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_SerializationContext))))) __PYX_ERR(14, 334, __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":333
 *     wrapped_value = [value]
 * 
 *     if context is None:             # <<<<<<<<<<<<<<
 *         context = _default_serialization_context
 * 
 */
  }

  /* "pyarrow/serialization.pxi":336
 *         context = _default_serialization_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":337
 * 
 *     with nogil:
 *         check_status(SerializeObject(context, wrapped_value, &serialized.data))             # <<<<<<<<<<<<<<
 *     return serialized
 * 
 */
        __pyx_t_4 = __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_4 == ((int)-1))) __PYX_ERR(14, 337, __pyx_L5_error)
      }

      /* "pyarrow/serialization.pxi":336
 *         context = _default_serialization_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":338
 *     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":315
 * 
 * 
 * def serialize(object value, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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":341
 * 
 * 
 * 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_145serialize_to(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_144serialize_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_145serialize_to = {"serialize_to", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_145serialize_to, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_144serialize_to};
static PyObject *__pyx_pw_7pyarrow_3lib_145serialize_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(14, 341, __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(14, 341, __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(14, 341, __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(14, 341, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_144serialize_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_144serialize_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":354
 *         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(14, 354, __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(14, 354, __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(14, 354, __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(14, 354, __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(14, 354, __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":355
 *     """
 *     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(14, 355, __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(14, 355, __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":341
 * 
 * 
 * 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":358
 * 
 * 
 * def read_serialized(source, base=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Read serialized Python sequence from file-like object
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_147read_serialized(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_146read_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_147read_serialized = {"read_serialized", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_147read_serialized, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_146read_serialized};
static PyObject *__pyx_pw_7pyarrow_3lib_147read_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(14, 358, __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(14, 358, __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_146read_serialized(__pyx_self, __pyx_v_source, __pyx_v_base);

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

static PyObject *__pyx_pf_7pyarrow_3lib_146read_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":374
 *     """
 *     cdef shared_ptr[RandomAccessFile] 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(14, 374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/serialization.pxi":376
 *     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(14, 376, __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":377
 * 
 *     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":378
 *     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":379
 *     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(14, 379, __pyx_L4_error)
      }

      /* "pyarrow/serialization.pxi":378
 *     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":381
 *         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":358
 * 
 * 
 * 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":384
 * 
 * 
 * def deserialize_from(source, object base, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize a Python sequence from a file.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_149deserialize_from(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_148deserialize_from[] = "deserialize_from(source, base, SerializationContext context=None)\nEXPERIMENTAL: Deserialize a Python sequence from a file.\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_149deserialize_from = {"deserialize_from", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_149deserialize_from, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_148deserialize_from};
static PyObject *__pyx_pw_7pyarrow_3lib_149deserialize_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(14, 384, __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(14, 384, __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(14, 384, __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(14, 384, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_148deserialize_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_148deserialize_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":402
 *         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(14, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 402, __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(14, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_base, __pyx_v_base) < 0) __PYX_ERR(14, 402, __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(14, 402, __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":403
 *     """
 *     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(14, 403, __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(14, 403, __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":384
 * 
 * 
 * def deserialize_from(source, object base, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize a Python sequence from a file.
 * 
 */

  /* 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":406
 * 
 * 
 * def deserialize_components(components, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct Python object from output of SerializedPyObject.to_components
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_151deserialize_components(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_150deserialize_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_151deserialize_components = {"deserialize_components", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_151deserialize_components, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_150deserialize_components};
static PyObject *__pyx_pw_7pyarrow_3lib_151deserialize_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(14, 406, __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(14, 406, __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(14, 406, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_150deserialize_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_150deserialize_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":420
 *     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(14, 420, __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(14, 420, __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":421
 *     """
 *     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(14, 421, __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(14, 421, __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":406
 * 
 * 
 * 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":424
 * 
 * 
 * def deserialize(obj, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     EXPERIMENTAL: Deserialize Python object from Buffer or other Python object
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_153deserialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_152deserialize[] = "deserialize(obj, SerializationContext context=None)\n\n    EXPERIMENTAL: Deserialize Python object from Buffer or other Python object\n    supporting the buffer protocol\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_153deserialize = {"deserialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_153deserialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_152deserialize};
static PyObject *__pyx_pw_7pyarrow_3lib_153deserialize(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(14, 424, __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(14, 424, __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(14, 424, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_152deserialize(__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_152deserialize(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":439
 *     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(14, 439, __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":440
 *     """
 *     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(14, 440, __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(14, 440, __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(14, 440, __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(14, 440, __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(14, 440, __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":424
 * 
 * 
 * def deserialize(obj, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     EXPERIMENTAL: Deserialize Python object from Buffer or other Python object
 */

  /* 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_155benchmark_PandasObjectIsNull(PyObject *__pyx_self, PyObject *__pyx_v_obj); /*proto*/
static char __pyx_doc_7pyarrow_3lib_154benchmark_PandasObjectIsNull[] = "benchmark_PandasObjectIsNull(list obj)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_155benchmark_PandasObjectIsNull = {"benchmark_PandasObjectIsNull", (PyCFunction)__pyx_pw_7pyarrow_3lib_155benchmark_PandasObjectIsNull, METH_O, __pyx_doc_7pyarrow_3lib_154benchmark_PandasObjectIsNull};
static PyObject *__pyx_pw_7pyarrow_3lib_155benchmark_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(15, 19, __pyx_L1_error)
  __pyx_r = __pyx_pf_7pyarrow_3lib_154benchmark_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_154benchmark_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(15, 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":27
 * 
 * 
 * cdef public api bint pyarrow_is_buffer(object buffer):             # <<<<<<<<<<<<<<
 *     return isinstance(buffer, Buffer)
 * 
 */

int 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":28
 * 
 * cdef public 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":27
 * 
 * 
 * cdef public 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":31
 * 
 * 
 * cdef public 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":33
 * cdef public 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 = (pyarrow_is_buffer(__pyx_v_buffer) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":34
 *     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":35
 *     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":33
 * cdef public 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":37
 *         return buf.buffer
 * 
 *     return shared_ptr[CBuffer]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Buffer> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":31
 * 
 * 
 * cdef public 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":40
 * 
 * 
 * cdef public 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":41
 * 
 * cdef public 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(16, 41, __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":42
 * cdef public 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":43
 *     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":40
 * 
 * 
 * cdef public 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":46
 * 
 * 
 * cdef public 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":48
 * cdef public 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(16, 48, __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":49
 *         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":50
 *     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":46
 * 
 * 
 * cdef public 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":53
 * 
 * 
 * cdef public api bint pyarrow_is_data_type(object type_):             # <<<<<<<<<<<<<<
 *     return isinstance(type_, DataType)
 * 
 */

int 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":54
 * 
 * cdef public 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":53
 * 
 * 
 * cdef public 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":57
 * 
 * 
 * cdef public 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":60
 *         object data_type):
 *     cdef DataType type_
 *     if pyarrow_is_data_type(data_type):             # <<<<<<<<<<<<<<
 *         type_ = <DataType>(data_type)
 *         return type_.sp_type
 */
  __pyx_t_1 = (pyarrow_is_data_type(__pyx_v_data_type) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":61
 *     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":62
 *     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":60
 *         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":64
 *         return type_.sp_type
 * 
 *     return shared_ptr[CDataType]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::DataType> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":57
 * 
 * 
 * cdef public 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":67
 * 
 * 
 * cdef public api object pyarrow_wrap_data_type(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CDataType]& type):
 *     cdef DataType out
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_data_type(std::shared_ptr< arrow::DataType>  const &__pyx_v_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_RefNannySetupContext("pyarrow_wrap_data_type", 0);

  /* "pyarrow/public-api.pxi":71
 *     cdef 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":72
 * 
 *     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":71
 *     cdef DataType out
 * 
 *     if type.get() == NULL:             # <<<<<<<<<<<<<<
 *         return None
 * 
 */
  }

  /* "pyarrow/public-api.pxi":74
 *         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":75
 * 
 *     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(16, 75, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(16, 75, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":74
 *         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":76
 *     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_STRUCT:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::LIST) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":77
 *         out = DictionaryType.__new__(DictionaryType)
 *     elif type.get().id() == _Type_LIST:
 *         out = ListType.__new__(ListType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_STRUCT:
 *         out = StructType.__new__(StructType)
 */
    __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(16, 77, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(16, 77, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":76
 *     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_STRUCT:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":78
 *     elif type.get().id() == _Type_LIST:
 *         out = ListType.__new__(ListType)
 *     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":79
 *         out = ListType.__new__(ListType)
 *     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(16, 79, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(16, 79, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":78
 *     elif type.get().id() == _Type_LIST:
 *         out = ListType.__new__(ListType)
 *     elif type.get().id() == _Type_STRUCT:             # <<<<<<<<<<<<<<
 *         out = StructType.__new__(StructType)
 *     elif type.get().id() == _Type_UNION:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":80
 *     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":81
 *         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(16, 81, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(16, 81, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":80
 *     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":82
 *     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_FIXED_SIZE_BINARY:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::TIMESTAMP) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":83
 *         out = UnionType.__new__(UnionType)
 *     elif type.get().id() == _Type_TIMESTAMP:
 *         out = TimestampType.__new__(TimestampType)             # <<<<<<<<<<<<<<
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)
 */
    __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(16, 83, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(16, 83, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":82
 *     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_FIXED_SIZE_BINARY:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":84
 *     elif type.get().id() == _Type_TIMESTAMP:
 *         out = TimestampType.__new__(TimestampType)
 *     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":85
 *         out = TimestampType.__new__(TimestampType)
 *     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(16, 85, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(16, 85, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":84
 *     elif type.get().id() == _Type_TIMESTAMP:
 *         out = TimestampType.__new__(TimestampType)
 *     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":86
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)
 *     elif type.get().id() == _Type_DECIMAL:             # <<<<<<<<<<<<<<
 *         out = Decimal128Type.__new__(Decimal128Type)
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_type.get()->id() ==  arrow::Type::DECIMAL) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":87
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)
 *     elif type.get().id() == _Type_DECIMAL:
 *         out = Decimal128Type.__new__(Decimal128Type)             # <<<<<<<<<<<<<<
 *     else:
 *         out = DataType.__new__(DataType)
 */
    __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(16, 87, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_7pyarrow_3lib_DataType)))) __PYX_ERR(16, 87, __pyx_L1_error)
    __pyx_v_out = ((struct __pyx_obj_7pyarrow_3lib_DataType *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":86
 *     elif type.get().id() == _Type_FIXED_SIZE_BINARY:
 *         out = FixedSizeBinaryType.__new__(FixedSizeBinaryType)
 *     elif type.get().id() == _Type_DECIMAL:             # <<<<<<<<<<<<<<
 *         out = Decimal128Type.__new__(Decimal128Type)
 *     else:
 */
    goto __pyx_L4;
  }

  /* "pyarrow/public-api.pxi":89
 *         out = Decimal128Type.__new__(Decimal128Type)
 *     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(16, 89, __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":91
 *         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);

  /* "pyarrow/public-api.pxi":92
 * 
 *     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":67
 * 
 * 
 * cdef public api object pyarrow_wrap_data_type(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CDataType]& type):
 *     cdef DataType out
 */

  /* 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":95
 * 
 * 
 * cdef public api bint pyarrow_is_field(object field):             # <<<<<<<<<<<<<<
 *     return isinstance(field, Field)
 * 
 */

int 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":96
 * 
 * cdef public 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":95
 * 
 * 
 * cdef public 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":99
 * 
 * 
 * cdef public 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":101
 * cdef public 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 = (pyarrow_is_field(__pyx_v_field) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":102
 *     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":103
 *     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":101
 * cdef public 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":105
 *         return field_.sp_field
 * 
 *     return shared_ptr[CField]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Field> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":99
 * 
 * 
 * cdef public 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":108
 * 
 * 
 * cdef public 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":109
 * 
 * cdef public 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":110
 * cdef public 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":109
 * 
 * cdef public 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":111
 *     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(16, 111, __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":112
 *         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":113
 *     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":108
 * 
 * 
 * cdef public 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":116
 * 
 * 
 * cdef public api bint pyarrow_is_schema(object schema):             # <<<<<<<<<<<<<<
 *     return isinstance(schema, Schema)
 * 
 */

int 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":117
 * 
 * cdef public 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":116
 * 
 * 
 * cdef public 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":120
 * 
 * 
 * cdef public 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":122
 * cdef public 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 = (pyarrow_is_schema(__pyx_v_schema) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":123
 *     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":124
 *     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":122
 * cdef public 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":126
 *         return sch.sp_schema
 * 
 *     return shared_ptr[CSchema]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Schema> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":120
 * 
 * 
 * cdef public 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":129
 * 
 * 
 * cdef public 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":130
 * 
 * cdef public 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(16, 130, __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":131
 * cdef public 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":132
 *     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":129
 * 
 * 
 * cdef public 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":135
 * 
 * 
 * cdef public api bint pyarrow_is_array(object array):             # <<<<<<<<<<<<<<
 *     return isinstance(array, Array)
 * 
 */

int 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":136
 * 
 * cdef public 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":135
 * 
 * 
 * cdef public 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":139
 * 
 * 
 * cdef public 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":141
 * cdef public 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 = (pyarrow_is_array(__pyx_v_array) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":142
 *     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":143
 *     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":141
 * cdef public 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":145
 *         return arr.sp_array
 * 
 *     return shared_ptr[CArray]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Array> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":139
 * 
 * 
 * cdef public 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":148
 * 
 * 
 * cdef public 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":149
 * 
 * cdef public 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":150
 * cdef public 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__174, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 150, __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(16, 150, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":149
 * 
 * cdef public 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":152
 *         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":154
 *     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":155
 * 
 *     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__175, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 155, __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(16, 155, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":154
 *     cdef CDataType* data_type = sp_array.get().type().get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('Array data type was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":157
 *         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(16, 157, __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(16, 157, __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(16, 157, __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":159
 *     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(16, 159, __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(16, 159, __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(16, 159, __pyx_L1_error)
  __pyx_v_arr = ((struct __pyx_obj_7pyarrow_3lib_Array *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pyarrow/public-api.pxi":160
 * 
 *     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);

  /* "pyarrow/public-api.pxi":161
 *     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":148
 * 
 * 
 * cdef public 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":164
 * 
 * 
 * cdef public api object pyarrow_wrap_chunked_array(             # <<<<<<<<<<<<<<
 *         const shared_ptr[CChunkedArray]& sp_array):
 *     if sp_array.get() == NULL:
 */

PyObject *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":166
 * cdef public 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":167
 *         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__176, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 167, __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(16, 167, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":166
 * cdef public 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":169
 *         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":171
 *     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":172
 * 
 *     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__177, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 172, __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(16, 172, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":171
 *     cdef CDataType* data_type = sp_array.get().type().get()
 * 
 *     if data_type == NULL:             # <<<<<<<<<<<<<<
 *         raise ValueError('ChunkedArray data type was NULL')
 * 
 */
  }

  /* "pyarrow/public-api.pxi":174
 *         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(16, 174, __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":175
 * 
 *     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":176
 *     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":164
 * 
 * 
 * cdef public 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":179
 * 
 * 
 * cdef public api bint pyarrow_is_tensor(object tensor):             # <<<<<<<<<<<<<<
 *     return isinstance(tensor, Tensor)
 * 
 */

int 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":180
 * 
 * cdef public 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":179
 * 
 * 
 * cdef public 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":183
 * 
 * 
 * cdef public 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":185
 * cdef public 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 = (pyarrow_is_tensor(__pyx_v_tensor) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":186
 *     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":187
 *     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":185
 * cdef public 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":189
 *         return ten.sp_tensor
 * 
 *     return shared_ptr[CTensor]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Tensor> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":183
 * 
 * 
 * cdef public 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":192
 * 
 * 
 * cdef public 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":194
 * cdef public 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":195
 *         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__178, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(16, 195, __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(16, 195, __pyx_L1_error)

    /* "pyarrow/public-api.pxi":194
 * cdef public 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":197
 *         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(16, 197, __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":198
 * 
 *     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":199
 *     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":192
 * 
 * 
 * cdef public 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":202
 * 
 * 
 * cdef public api bint pyarrow_is_column(object column):             # <<<<<<<<<<<<<<
 *     return isinstance(column, Column)
 * 
 */

int pyarrow_is_column(PyObject *__pyx_v_column) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pyarrow_is_column", 0);

  /* "pyarrow/public-api.pxi":203
 * 
 * cdef public api bint pyarrow_is_column(object column):
 *     return isinstance(column, Column)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_column, __pyx_ptype_7pyarrow_3lib_Column); 
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":202
 * 
 * 
 * cdef public api bint pyarrow_is_column(object column):             # <<<<<<<<<<<<<<
 *     return isinstance(column, Column)
 * 
 */

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

/* "pyarrow/public-api.pxi":206
 * 
 * 
 * cdef public api shared_ptr[CColumn] pyarrow_unwrap_column(object column):             # <<<<<<<<<<<<<<
 *     cdef Column col
 *     if pyarrow_is_column(column):
 */

std::shared_ptr< arrow::Column>  __pyx_f_7pyarrow_3lib_pyarrow_unwrap_column(PyObject *__pyx_v_column) {
  struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_col = 0;
  std::shared_ptr< arrow::Column>  __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_unwrap_column", 0);

  /* "pyarrow/public-api.pxi":208
 * cdef public api shared_ptr[CColumn] pyarrow_unwrap_column(object column):
 *     cdef Column col
 *     if pyarrow_is_column(column):             # <<<<<<<<<<<<<<
 *         col = <Column>(column)
 *         return col.sp_column
 */
  __pyx_t_1 = (pyarrow_is_column(__pyx_v_column) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":209
 *     cdef Column col
 *     if pyarrow_is_column(column):
 *         col = <Column>(column)             # <<<<<<<<<<<<<<
 *         return col.sp_column
 * 
 */
    __pyx_t_2 = __pyx_v_column;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v_col = ((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyarrow/public-api.pxi":210
 *     if pyarrow_is_column(column):
 *         col = <Column>(column)
 *         return col.sp_column             # <<<<<<<<<<<<<<
 * 
 *     return shared_ptr[CColumn]()
 */
    __pyx_r = __pyx_v_col->sp_column;
    goto __pyx_L0;

    /* "pyarrow/public-api.pxi":208
 * cdef public api shared_ptr[CColumn] pyarrow_unwrap_column(object column):
 *     cdef Column col
 *     if pyarrow_is_column(column):             # <<<<<<<<<<<<<<
 *         col = <Column>(column)
 *         return col.sp_column
 */
  }

  /* "pyarrow/public-api.pxi":212
 *         return col.sp_column
 * 
 *     return shared_ptr[CColumn]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Column> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":206
 * 
 * 
 * cdef public api shared_ptr[CColumn] pyarrow_unwrap_column(object column):             # <<<<<<<<<<<<<<
 *     cdef Column col
 *     if pyarrow_is_column(column):
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_col);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyarrow/public-api.pxi":215
 * 
 * 
 * cdef public api object pyarrow_wrap_column(const shared_ptr[CColumn]& ccolumn):             # <<<<<<<<<<<<<<
 *     cdef Column column = Column.__new__(Column)
 *     column.init(ccolumn)
 */

PyObject *__pyx_f_7pyarrow_3lib_pyarrow_wrap_column(std::shared_ptr< arrow::Column>  const &__pyx_v_ccolumn) {
  struct __pyx_obj_7pyarrow_3lib_Column *__pyx_v_column = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_column", 0);

  /* "pyarrow/public-api.pxi":216
 * 
 * cdef public api object pyarrow_wrap_column(const shared_ptr[CColumn]& ccolumn):
 *     cdef Column column = Column.__new__(Column)             # <<<<<<<<<<<<<<
 *     column.init(ccolumn)
 *     return column
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Column(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Column), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 216, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_column = ((struct __pyx_obj_7pyarrow_3lib_Column *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/public-api.pxi":217
 * cdef public api object pyarrow_wrap_column(const shared_ptr[CColumn]& ccolumn):
 *     cdef Column column = Column.__new__(Column)
 *     column.init(ccolumn)             # <<<<<<<<<<<<<<
 *     return column
 * 
 */
  ((struct __pyx_vtabstruct_7pyarrow_3lib_Column *)__pyx_v_column->__pyx_vtab)->init(__pyx_v_column, __pyx_v_ccolumn);

  /* "pyarrow/public-api.pxi":218
 *     cdef Column column = Column.__new__(Column)
 *     column.init(ccolumn)
 *     return column             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_column));
  __pyx_r = ((PyObject *)__pyx_v_column);
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":215
 * 
 * 
 * cdef public api object pyarrow_wrap_column(const shared_ptr[CColumn]& ccolumn):             # <<<<<<<<<<<<<<
 *     cdef Column column = Column.__new__(Column)
 *     column.init(ccolumn)
 */

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

/* "pyarrow/public-api.pxi":221
 * 
 * 
 * cdef public api bint pyarrow_is_table(object table):             # <<<<<<<<<<<<<<
 *     return isinstance(table, Table)
 * 
 */

int 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":222
 * 
 * cdef public 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":221
 * 
 * 
 * cdef public 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":225
 * 
 * 
 * cdef public 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":227
 * cdef public 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 = (pyarrow_is_table(__pyx_v_table) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":228
 *     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":229
 *     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":227
 * cdef public 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":231
 *         return tab.sp_table
 * 
 *     return shared_ptr[CTable]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::Table> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":225
 * 
 * 
 * cdef public 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":234
 * 
 * 
 * cdef public api object pyarrow_wrap_table(const shared_ptr[CTable]& ctable):             # <<<<<<<<<<<<<<
 *     cdef Table table = Table.__new__(Table)
 *     table.init(ctable)
 */

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
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("pyarrow_wrap_table", 0);

  /* "pyarrow/public-api.pxi":235
 * 
 * cdef public api object pyarrow_wrap_table(const shared_ptr[CTable]& ctable):
 *     cdef Table table = Table.__new__(Table)             # <<<<<<<<<<<<<<
 *     table.init(ctable)
 *     return table
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_Table(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_Table), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(16, 235, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_table = ((struct __pyx_obj_7pyarrow_3lib_Table *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/public-api.pxi":236
 * cdef public api object pyarrow_wrap_table(const shared_ptr[CTable]& ctable):
 *     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":237
 *     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":234
 * 
 * 
 * cdef public api object pyarrow_wrap_table(const shared_ptr[CTable]& ctable):             # <<<<<<<<<<<<<<
 *     cdef Table table = Table.__new__(Table)
 *     table.init(ctable)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __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":240
 * 
 * 
 * cdef public api bint pyarrow_is_batch(object batch):             # <<<<<<<<<<<<<<
 *     return isinstance(batch, RecordBatch)
 * 
 */

int 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":241
 * 
 * cdef public 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":240
 * 
 * 
 * cdef public 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":244
 * 
 * 
 * cdef public 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":246
 * cdef public 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 = (pyarrow_is_batch(__pyx_v_batch) != 0);
  if (__pyx_t_1) {

    /* "pyarrow/public-api.pxi":247
 *     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":248
 *     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":246
 * cdef public 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":250
 *         return bat.sp_batch
 * 
 *     return shared_ptr[CRecordBatch]()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::shared_ptr< arrow::RecordBatch> ();
  goto __pyx_L0;

  /* "pyarrow/public-api.pxi":244
 * 
 * 
 * cdef public 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":253
 * 
 * 
 * cdef public 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":255
 * cdef public 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(16, 255, __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":256
 *         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":257
 *     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":253
 * 
 * 
 * cdef public 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_SerializationContext(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     if __pyx_checksum != 0x9aeed6f:
 *         from pickle import PickleError as __pyx_PickleError
 */

/* Python wrapper */
static PyObject *__pyx_pw_7pyarrow_3lib_164__pyx_unpickle_SerializationContext(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7pyarrow_3lib_163__pyx_unpickle_SerializationContext[] = "__pyx_unpickle_SerializationContext(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_7pyarrow_3lib_164__pyx_unpickle_SerializationContext = {"__pyx_unpickle_SerializationContext", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_164__pyx_unpickle_SerializationContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_163__pyx_unpickle_SerializationContext};
static PyObject *__pyx_pw_7pyarrow_3lib_164__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(8, 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(8, 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(8, 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(8, 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(8, 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_163__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_163__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 = NULL;
  PyObject *__pyx_v___pyx_result = 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;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SerializationContext", 0);

  /* "(tree fragment)":2
 * def __pyx_unpickle_SerializationContext(__pyx_type, long __pyx_checksum, __pyx_state):
 *     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)":3
 * def __pyx_unpickle_SerializationContext(__pyx_type, long __pyx_checksum, __pyx_state):
 *     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(8, 3, __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, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 3, __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(8, 3, __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)":4
 *     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(8, 4, __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(8, 4, __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(8, 4, __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(8, 4, __pyx_L1_error)

    /* "(tree fragment)":2
 * def __pyx_unpickle_SerializationContext(__pyx_type, long __pyx_checksum, __pyx_state):
 *     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)":5
 *         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(8, 5, __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(8, 5, __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)":6
 *         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)":7
 *     __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(8, 7, __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(8, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *         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)":8
 *     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):             # <<<<<<<<<<<<<<
 *     if __pyx_checksum != 0x9aeed6f:
 *         from pickle import PickleError as __pyx_PickleError
 */

  /* 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)":9
 *         __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)":10
 *     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(8, 10, __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(8, 10, __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(8, 10, __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(8, 10, __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(8, 10, __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(8, 10, __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(8, 10, __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(8, 10, __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(8, 10, __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(8, 10, __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(8, 10, __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(8, 10, __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(8, 10, __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(8, 10, __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)":11
 * 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(8, 11, __pyx_L1_error)
  }
  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(8, 11, __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(8, 11, __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)":12
 *     __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(8, 12, __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(8, 12, __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(8, 12, __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(8, 12, __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(8, 12, __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)":11
 * 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)":9
 *         __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;
}

/* "pyarrow/includes/common.pxd":67
 * 
 * 
 * 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":69
 * 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":70
 *     # 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":71
 *     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":67
 * 
 * 
 * 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;
}

/* "FromPyStructUtility":11
 * 
 * @cname("__pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions")
 * cdef struct_type __pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

static struct arrow::py::PandasOptions __pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions(PyObject *__pyx_v_obj) {
  struct arrow::py::PandasOptions __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  struct arrow::py::PandasOptions __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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  bool __pyx_t_10;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions", 0);

  /* "FromPyStructUtility":13
 * cdef struct_type __pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":14
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = PyErr_Format(__pyx_builtin_TypeError, ((char const *)"Expected %.16s, got %.200s"), ((char *)"a mapping"), Py_TYPE(__pyx_v_obj)->tp_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":13
 * cdef struct_type __pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
 * 
 */
  }

  /* "FromPyStructUtility":16
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['strings_to_categorical']
 *     except KeyError:
 */
  {
    __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:*/ {

      /* "FromPyStructUtility":17
 * 
 *     try:
 *         value = obj['strings_to_categorical']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'strings_to_categorical'")
 */
      __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_strings_to_categorical); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 17, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_v_value = __pyx_t_2;
      __pyx_t_2 = 0;

      /* "FromPyStructUtility":16
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['strings_to_categorical']
 *     except KeyError:
 */
    }
    __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_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":18
 *     try:
 *         value = obj['strings_to_categorical']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'strings_to_categorical'")
 *     result.strings_to_categorical = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(8, 18, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":19
 *         value = obj['strings_to_categorical']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'strings_to_categorical'")             # <<<<<<<<<<<<<<
 *     result.strings_to_categorical = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__179, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(8, 19, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":16
 *         PyErr_Format(TypeError, b"Expected %.16s, got %.200s", b"a mapping", Py_TYPE(obj).tp_name)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['strings_to_categorical']
 *     except KeyError:
 */
    __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_L9_try_end:;
  }

  /* "FromPyStructUtility":20
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'strings_to_categorical'")
 *     result.strings_to_categorical = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['zero_copy_only']
 */
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_10 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(8, 20, __pyx_L1_error)
  __pyx_v_result.strings_to_categorical = __pyx_t_10;

  /* "FromPyStructUtility":21
 *         raise ValueError("No value specified for struct attribute 'strings_to_categorical'")
 *     result.strings_to_categorical = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['zero_copy_only']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":22
 *     result.strings_to_categorical = value
 *     try:
 *         value = obj['zero_copy_only']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'zero_copy_only'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_zero_copy_only); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 22, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":21
 *         raise ValueError("No value specified for struct attribute 'strings_to_categorical'")
 *     result.strings_to_categorical = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['zero_copy_only']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "FromPyStructUtility":23
 *     try:
 *         value = obj['zero_copy_only']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'zero_copy_only'")
 *     result.zero_copy_only = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(8, 23, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "FromPyStructUtility":24
 *         value = obj['zero_copy_only']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'zero_copy_only'")             # <<<<<<<<<<<<<<
 *     result.zero_copy_only = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__180, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 24, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(8, 24, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;
    __pyx_L14_except_error:;

    /* "FromPyStructUtility":21
 *         raise ValueError("No value specified for struct attribute 'strings_to_categorical'")
 *     result.strings_to_categorical = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['zero_copy_only']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "FromPyStructUtility":25
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'zero_copy_only'")
 *     result.zero_copy_only = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['integer_object_nulls']
 */
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_10 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(8, 25, __pyx_L1_error)
  __pyx_v_result.zero_copy_only = __pyx_t_10;

  /* "FromPyStructUtility":26
 *         raise ValueError("No value specified for struct attribute 'zero_copy_only'")
 *     result.zero_copy_only = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['integer_object_nulls']
 *     except KeyError:
 */
  {
    __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:*/ {

      /* "FromPyStructUtility":27
 *     result.zero_copy_only = value
 *     try:
 *         value = obj['integer_object_nulls']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'integer_object_nulls'")
 */
      __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_integer_object_nulls); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 27, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "FromPyStructUtility":26
 *         raise ValueError("No value specified for struct attribute 'zero_copy_only'")
 *     result.zero_copy_only = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['integer_object_nulls']
 *     except KeyError:
 */
    }
    __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_L25_try_end;
    __pyx_L20_error:;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":28
 *     try:
 *         value = obj['integer_object_nulls']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'integer_object_nulls'")
 *     result.integer_object_nulls = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(8, 28, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":29
 *         value = obj['integer_object_nulls']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'integer_object_nulls'")             # <<<<<<<<<<<<<<
 *     result.integer_object_nulls = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__181, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 29, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(8, 29, __pyx_L22_except_error)
    }
    goto __pyx_L22_except_error;
    __pyx_L22_except_error:;

    /* "FromPyStructUtility":26
 *         raise ValueError("No value specified for struct attribute 'zero_copy_only'")
 *     result.zero_copy_only = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['integer_object_nulls']
 *     except KeyError:
 */
    __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_L25_try_end:;
  }

  /* "FromPyStructUtility":30
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'integer_object_nulls'")
 *     result.integer_object_nulls = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['date_as_object']
 */
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_10 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(8, 30, __pyx_L1_error)
  __pyx_v_result.integer_object_nulls = __pyx_t_10;

  /* "FromPyStructUtility":31
 *         raise ValueError("No value specified for struct attribute 'integer_object_nulls'")
 *     result.integer_object_nulls = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['date_as_object']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":32
 *     result.integer_object_nulls = value
 *     try:
 *         value = obj['date_as_object']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'date_as_object'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_date_as_object); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 32, __pyx_L28_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":31
 *         raise ValueError("No value specified for struct attribute 'integer_object_nulls'")
 *     result.integer_object_nulls = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['date_as_object']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L33_try_end;
    __pyx_L28_error:;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "FromPyStructUtility":33
 *     try:
 *         value = obj['date_as_object']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'date_as_object'")
 *     result.date_as_object = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_2) < 0) __PYX_ERR(8, 33, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_2);

      /* "FromPyStructUtility":34
 *         value = obj['date_as_object']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'date_as_object'")             # <<<<<<<<<<<<<<
 *     result.date_as_object = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__182, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 34, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(8, 34, __pyx_L30_except_error)
    }
    goto __pyx_L30_except_error;
    __pyx_L30_except_error:;

    /* "FromPyStructUtility":31
 *         raise ValueError("No value specified for struct attribute 'integer_object_nulls'")
 *     result.integer_object_nulls = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['date_as_object']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L33_try_end:;
  }

  /* "FromPyStructUtility":35
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'date_as_object'")
 *     result.date_as_object = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['use_threads']
 */
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_10 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(8, 35, __pyx_L1_error)
  __pyx_v_result.date_as_object = __pyx_t_10;

  /* "FromPyStructUtility":36
 *         raise ValueError("No value specified for struct attribute 'date_as_object'")
 *     result.date_as_object = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['use_threads']
 *     except KeyError:
 */
  {
    __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:*/ {

      /* "FromPyStructUtility":37
 *     result.date_as_object = value
 *     try:
 *         value = obj['use_threads']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'use_threads'")
 */
      __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_use_threads); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 37, __pyx_L36_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "FromPyStructUtility":36
 *         raise ValueError("No value specified for struct attribute 'date_as_object'")
 *     result.date_as_object = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['use_threads']
 *     except KeyError:
 */
    }
    __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_L41_try_end;
    __pyx_L36_error:;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "FromPyStructUtility":38
 *     try:
 *         value = obj['use_threads']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'use_threads'")
 *     result.use_threads = value
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(8, 38, __pyx_L38_except_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":39
 *         value = obj['use_threads']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'use_threads'")             # <<<<<<<<<<<<<<
 *     result.use_threads = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__183, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 39, __pyx_L38_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(8, 39, __pyx_L38_except_error)
    }
    goto __pyx_L38_except_error;
    __pyx_L38_except_error:;

    /* "FromPyStructUtility":36
 *         raise ValueError("No value specified for struct attribute 'date_as_object'")
 *     result.date_as_object = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['use_threads']
 *     except KeyError:
 */
    __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_L41_try_end:;
  }

  /* "FromPyStructUtility":40
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'use_threads'")
 *     result.use_threads = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_10 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(8, 40, __pyx_L1_error)
  __pyx_v_result.use_threads = __pyx_t_10;

  /* "FromPyStructUtility":41
 *         raise ValueError("No value specified for struct attribute 'use_threads'")
 *     result.use_threads = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":11
 * 
 * @cname("__pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions")
 * cdef struct_type __pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __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(8, 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(8, 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(8, 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(8, 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(8, 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
 *     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":15
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
 *     cdef Py_ssize_t length
 *     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(8, 15, __pyx_L1_error)
  __pyx_v_data = __pyx_t_1;

  /* "string.from_py":16
 *     cdef Py_ssize_t length
 *     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
 *     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;
}

/* "map.to_py":201
 * 
 * @cname("__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_string")
 * cdef object __pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_string(const map[X,Y]& s):             # <<<<<<<<<<<<<<
 *     o = {}
 *     cdef const map[X,Y].value_type *key_value
 */

static PyObject *__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_string(std::unordered_map<std::string,std::string>  const &__pyx_v_s) {
  PyObject *__pyx_v_o = NULL;
  std::unordered_map<std::string,std::string> ::value_type const *__pyx_v_key_value;
  std::unordered_map<std::string,std::string> ::const_iterator __pyx_v_iter;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_string", 0);

  /* "map.to_py":202
 * @cname("__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_string")
 * cdef object __pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_string(const map[X,Y]& s):
 *     o = {}             # <<<<<<<<<<<<<<
 *     cdef const map[X,Y].value_type *key_value
 *     cdef map[X,Y].const_iterator iter = s.begin()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_o = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "map.to_py":204
 *     o = {}
 *     cdef const map[X,Y].value_type *key_value
 *     cdef map[X,Y].const_iterator iter = s.begin()             # <<<<<<<<<<<<<<
 *     while iter != s.end():
 *         key_value = &cython.operator.dereference(iter)
 */
  __pyx_v_iter = __pyx_v_s.begin();

  /* "map.to_py":205
 *     cdef const map[X,Y].value_type *key_value
 *     cdef map[X,Y].const_iterator iter = s.begin()
 *     while iter != s.end():             # <<<<<<<<<<<<<<
 *         key_value = &cython.operator.dereference(iter)
 *         o[key_value.first] = key_value.second
 */
  while (1) {
    __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0);
    if (!__pyx_t_2) break;

    /* "map.to_py":206
 *     cdef map[X,Y].const_iterator iter = s.begin()
 *     while iter != s.end():
 *         key_value = &cython.operator.dereference(iter)             # <<<<<<<<<<<<<<
 *         o[key_value.first] = key_value.second
 *         cython.operator.preincrement(iter)
 */
    __pyx_v_key_value = (&(*__pyx_v_iter));

    /* "map.to_py":207
 *     while iter != s.end():
 *         key_value = &cython.operator.dereference(iter)
 *         o[key_value.first] = key_value.second             # <<<<<<<<<<<<<<
 *         cython.operator.preincrement(iter)
 *     return o
 */
    __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(8, 207, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "map.to_py":208
 *         key_value = &cython.operator.dereference(iter)
 *         o[key_value.first] = key_value.second
 *         cython.operator.preincrement(iter)             # <<<<<<<<<<<<<<
 *     return o
 * 
 */
    (void)((++__pyx_v_iter));
  }

  /* "map.to_py":209
 *         o[key_value.first] = key_value.second
 *         cython.operator.preincrement(iter)
 *     return o             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_o);
  __pyx_r = __pyx_v_o;
  goto __pyx_L0;

  /* "map.to_py":201
 * 
 * @cname("__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_string")
 * cdef object __pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_string(const map[X,Y]& s):             # <<<<<<<<<<<<<<
 *     o = {}
 *     cdef const map[X,Y].value_type *key_value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("map.to_py.__pyx_convert_unordered_map_to_py_std_3a__3a_string____std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_o);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "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())]
 * 
 */

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(8, 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(8, 61, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(8, 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(8, 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(8, 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(8, 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(8, 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(8, 178, __pyx_L1_error)
    __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(8, 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;
}

/* "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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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;
}

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", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_7Message_7serialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_7Message_6serialize},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_7Message_11__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_7Message_10__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_7Message_13__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_7Message_12__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*/
  0, /*tp_print*/
  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_9__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
};
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},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10MemoryPool_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10MemoryPool_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10MemoryPool_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10MemoryPool_6__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*/
  0, /*tp_print*/
  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()", /*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
};
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
  __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 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},
  {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*/
  0, /*tp_print*/
  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 type for Apache Arrow data type instances. Wraps C++ arrow::DataType\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
};
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 *)0, 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*/
  0, /*tp_print*/
  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*/
  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_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
};
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_dictionary(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_14DictionaryType_10dictionary_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 *)0, 0},
  {(char *)"index_type", __pyx_getprop_7pyarrow_3lib_14DictionaryType_index_type, 0, (char *)0, 0},
  {(char *)"dictionary", __pyx_getprop_7pyarrow_3lib_14DictionaryType_dictionary, 0, (char *)0, 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*/
  0, /*tp_print*/
  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*/
  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_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
};
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 *)0, 0},
  {(char *)"tz", __pyx_getprop_7pyarrow_3lib_13TimestampType_tz, 0, (char *)0, 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*/
  0, /*tp_print*/
  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*/
  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_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
};
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 *)0, 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*/
  0, /*tp_print*/
  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*/
  0, /*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
};
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 *)0, 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*/
  0, /*tp_print*/
  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*/
  0, /*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
};
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 *)0, 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*/
  0, /*tp_print*/
  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*/
  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_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
};
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 *)0, 0},
  {(char *)"scale", __pyx_getprop_7pyarrow_3lib_14Decimal128Type_scale, 0, (char *)0, 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*/
  0, /*tp_print*/
  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*/
  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_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
};
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},
  {"remove_metadata", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Field_19remove_metadata, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Field_18remove_metadata},
  {"flatten", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Field_21flatten, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Field_20flatten},
  {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*/
  0, /*tp_print*/
  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    Represents a named field, with a data type, nullability, and optional\n    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
};
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_14__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_6Schema_14__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_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__},
  {"empty_table", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_16empty_table, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Schema_15empty_table},
  {"equals", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_18equals, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_17equals},
  {"field_by_name", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_20field_by_name, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_19field_by_name},
  {"get_field_index", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_22get_field_index, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_21get_field_index},
  {"append", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_24append, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_23append},
  {"insert", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_26insert, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_25insert},
  {"remove", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_28remove, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_27remove},
  {"set", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_30set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_29set},
  {"add_metadata", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_32add_metadata, METH_O, __pyx_doc_7pyarrow_3lib_6Schema_31add_metadata},
  {"serialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Schema_34serialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Schema_33serialize},
  {"remove_metadata", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Schema_36remove_metadata, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Schema_35remove_metadata},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Schema[] = {
  {(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*/
  0, /*tp_print*/
  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_40__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Schema, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Schema, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_7pyarrow_3lib_6Schema_38__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
};

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 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*/
  0, /*tp_print*/
  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_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
};

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*/
  0, /*tp_print*/
  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
};
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*/
  0, /*tp_print*/
  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()", /*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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  0, /*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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  0, /*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
};
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},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StringValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11StringValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11StringValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11StringValue_4__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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Array __pyx_vtable_7pyarrow_3lib_Array;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Array(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Array *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_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);
  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);
  __Pyx_call_destructor(p->sp_array);
  Py_CLEAR(p->type);
  (*Py_TYPE(o)->tp_free)(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;
  if (p->type) {
    e = (*v)(((PyObject *)p->type), 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;
  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_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_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 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},
  {"cast", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_7cast, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_6cast},
  {"unique", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_9unique, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_8unique},
  {"dictionary_encode", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_11dictionary_encode, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_10dictionary_encode},
  {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_13from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_12from_pandas},
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_15__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_14__reduce__},
  {"from_buffers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_17from_buffers, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_16from_buffers},
  {"format", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_24format, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_23format},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_28equals, METH_O, __pyx_doc_7pyarrow_3lib_5Array_27equals},
  {"isnull", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_32isnull, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_31isnull},
  {"slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_36slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_35slice},
  {"to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_38to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_37to_pandas},
  {"__array__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Array_40__array__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Array_39__array__},
  {"to_numpy", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_42to_numpy, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_41to_numpy},
  {"to_pylist", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_44to_pylist, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_43to_pylist},
  {"validate", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_46validate, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_45validate},
  {"buffers", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Array_48buffers, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Array_47buffers},
  {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 *)"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},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_Array = {
  __pyx_pw_7pyarrow_3lib_5Array_30__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_30__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_5Array_34__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*/
  0, /*tp_print*/
  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_22__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_26__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()", /*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_19__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
};
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_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},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Tensor_15__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Tensor_14__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Tensor_17__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_6Tensor_16__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Tensor[] = {
  {(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_13__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*/
  0, /*tp_print*/
  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()", /*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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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 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},
  {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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_ListArray, /*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_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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
static struct __pyx_vtabstruct_7pyarrow_3lib_ChunkedArray __pyx_vtable_7pyarrow_3lib_ChunkedArray;

static PyObject *__pyx_tp_new_7pyarrow_3lib_ChunkedArray(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_ChunkedArray *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_ChunkedArray *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_ChunkedArray;
  new((void*)&(p->sp_chunked_array)) std::shared_ptr< arrow::ChunkedArray> ();
  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) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->sp_chunked_array);
  (*Py_TYPE(o)->tp_free)(o);
}
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_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_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 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},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_22equals, METH_O, __pyx_doc_7pyarrow_3lib_12ChunkedArray_21equals},
  {"to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_24to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_23to_pandas},
  {"__array__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_26__array__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_25__array__},
  {"dictionary_encode", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_28dictionary_encode, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_27dictionary_encode},
  {"unique", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_30unique, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_29unique},
  {"slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_12ChunkedArray_32slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_31slice},
  {"chunk", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_34chunk, METH_O, __pyx_doc_7pyarrow_3lib_12ChunkedArray_33chunk},
  {"iterchunks", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_36iterchunks, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_35iterchunks},
  {"to_pylist", (PyCFunction)__pyx_pw_7pyarrow_3lib_12ChunkedArray_39to_pylist, METH_NOARGS, __pyx_doc_7pyarrow_3lib_12ChunkedArray_38to_pylist},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_ChunkedArray[] = {
  {(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 *)"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},
  {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_20__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*/
  0, /*tp_print*/
  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, /*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*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_12ChunkedArray_17__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
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Column __pyx_vtable_7pyarrow_3lib_Column;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Column(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Column *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_Column *)o);
  p->__pyx_vtab = __pyx_vtabptr_7pyarrow_3lib_Column;
  new((void*)&(p->sp_column)) std::shared_ptr< arrow::Column> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_6Column_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_Column(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib_Column *p = (struct __pyx_obj_7pyarrow_3lib_Column *)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_column);
  (*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_7pyarrow_3lib_Column(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_6Column_field(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Column_5field_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Column_shape(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Column_5shape_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Column_null_count(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Column_10null_count_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Column_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Column_4name_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Column_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Column_4type_1__get__(o);
}

static PyObject *__pyx_getprop_7pyarrow_3lib_6Column_data(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_6Column_4data_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib_Column[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Column_5__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Column_4__reduce__},
  {"from_array", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Column_13from_array, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Column_12from_array},
  {"cast", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Column_15cast, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Column_14cast},
  {"dictionary_encode", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Column_17dictionary_encode, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Column_16dictionary_encode},
  {"unique", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Column_19unique, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Column_18unique},
  {"flatten", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Column_21flatten, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Column_20flatten},
  {"to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Column_23to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Column_22to_pandas},
  {"__array__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Column_25__array__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Column_24__array__},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Column_27equals, METH_O, __pyx_doc_7pyarrow_3lib_6Column_26equals},
  {"to_pylist", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Column_29to_pylist, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Column_28to_pylist},
  {"length", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Column_33length, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Column_32length},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Column[] = {
  {(char *)"field", __pyx_getprop_7pyarrow_3lib_6Column_field, 0, (char *)0, 0},
  {(char *)"shape", __pyx_getprop_7pyarrow_3lib_6Column_shape, 0, (char *)"\n        Dimensions of this columns\n\n        Returns\n        -------\n        (int,)\n        ", 0},
  {(char *)"null_count", __pyx_getprop_7pyarrow_3lib_6Column_null_count, 0, (char *)"\n        Number of null entires\n\n        Returns\n        -------\n        int\n        ", 0},
  {(char *)"name", __pyx_getprop_7pyarrow_3lib_6Column_name, 0, (char *)"\n        Label of the column\n\n        Returns\n        -------\n        str\n        ", 0},
  {(char *)"type", __pyx_getprop_7pyarrow_3lib_6Column_type, 0, (char *)"\n        Type information for this column\n\n        Returns\n        -------\n        pyarrow.DataType\n        ", 0},
  {(char *)"data", __pyx_getprop_7pyarrow_3lib_6Column_data, 0, (char *)"\n        The underlying data\n\n        Returns\n        -------\n        pyarrow.ChunkedArray\n        ", 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_Column = {
  __pyx_pw_7pyarrow_3lib_6Column_31__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7pyarrow_3lib_Column, /*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_Column = {
  __pyx_pw_7pyarrow_3lib_6Column_31__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_6Column_11__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7pyarrow_3lib_Column = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.Column", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib_Column), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib_Column, /*tp_dealloc*/
  0, /*tp_print*/
  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_6Column_7__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Column, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Column, /*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*/
  "Column()\n\n    Named vector of elements of equal type.\n\n    Warning\n    -------\n    Do not call this class's constructor directly.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  __pyx_pw_7pyarrow_3lib_6Column_9__richcmp__, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib_Column, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib_Column, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7pyarrow_3lib_6Column_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7pyarrow_3lib_Column, /*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
};
static struct __pyx_vtabstruct_7pyarrow_3lib_Table __pyx_vtable_7pyarrow_3lib_Table;

static PyObject *__pyx_tp_new_7pyarrow_3lib_Table(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_Table *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_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);
  (*Py_TYPE(o)->tp_free)(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_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 PyMethodDef __pyx_methods_7pyarrow_3lib_Table[] = {
  {"_validate", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_7_validate, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Table_6_validate},
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_9__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Table_8__reduce__},
  {"replace_schema_metadata", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_11replace_schema_metadata, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_10replace_schema_metadata},
  {"flatten", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_13flatten, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_12flatten},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_15equals, METH_O, __pyx_doc_7pyarrow_3lib_5Table_14equals},
  {"cast", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_17cast, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_16cast},
  {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_19from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_18from_pandas},
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_21from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_20from_arrays},
  {"from_batches", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_23from_batches, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_22from_batches},
  {"to_batches", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_25to_batches, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_24to_batches},
  {"to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_27to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_26to_pandas},
  {"to_pydict", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_29to_pydict, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Table_28to_pydict},
  {"column", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_31column, METH_O, __pyx_doc_7pyarrow_3lib_5Table_30column},
  {"_column", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_33_column, METH_O, __pyx_doc_7pyarrow_3lib_5Table_32_column},
  {"itercolumns", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_37itercolumns, METH_NOARGS, __pyx_doc_7pyarrow_3lib_5Table_36itercolumns},
  {"add_column", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_42add_column, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_41add_column},
  {"append_column", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_44append_column, METH_O, __pyx_doc_7pyarrow_3lib_5Table_43append_column},
  {"remove_column", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_46remove_column, METH_O, __pyx_doc_7pyarrow_3lib_5Table_45remove_column},
  {"set_column", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_5Table_48set_column, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_5Table_47set_column},
  {"drop", (PyCFunction)__pyx_pw_7pyarrow_3lib_5Table_50drop, METH_O, __pyx_doc_7pyarrow_3lib_5Table_49drop},
  {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.Column\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},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_Table = {
  __pyx_pw_7pyarrow_3lib_5Table_40__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_40__len__, /*mp_length*/
  __pyx_pw_7pyarrow_3lib_5Table_35__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*/
  0, /*tp_print*/
  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*/
  0, /*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
};
static struct __pyx_vtabstruct_7pyarrow_3lib_RecordBatch __pyx_vtable_7pyarrow_3lib_RecordBatch;

static PyObject *__pyx_tp_new_7pyarrow_3lib_RecordBatch(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib_RecordBatch *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_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);
  (*Py_TYPE(o)->tp_free)(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;
  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;
  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 PyMethodDef __pyx_methods_7pyarrow_3lib_RecordBatch[] = {
  {"__reduce__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11RecordBatch_5__reduce__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11RecordBatch_4__reduce__},
  {"replace_schema_metadata", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_9replace_schema_metadata, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_8replace_schema_metadata},
  {"column", (PyCFunction)__pyx_pw_7pyarrow_3lib_11RecordBatch_11column, METH_O, __pyx_doc_7pyarrow_3lib_11RecordBatch_10column},
  {"serialize", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_15serialize, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_14serialize},
  {"slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_17slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_16slice},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_11RecordBatch_19equals, METH_O, __pyx_doc_7pyarrow_3lib_11RecordBatch_18equals},
  {"to_pydict", (PyCFunction)__pyx_pw_7pyarrow_3lib_11RecordBatch_21to_pydict, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11RecordBatch_20to_pydict},
  {"to_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_23to_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_22to_pandas},
  {"from_pandas", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_25from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_24from_pandas},
  {"from_arrays", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_11RecordBatch_27from_arrays, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_11RecordBatch_26from_arrays},
  {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.Column\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_13__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*/
  0, /*tp_print*/
  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
};
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_13__eq__(o1, o2);
    }
    case Py_NE: {
      PyObject *ret;
      ret = __pyx_pw_7pyarrow_3lib_6Buffer_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_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[] = {
  {"slice", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_6Buffer_9slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_6Buffer_8slice},
  {"equals", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Buffer_11equals, METH_O, __pyx_doc_7pyarrow_3lib_6Buffer_10equals},
  {"__reduce_ex__", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Buffer_15__reduce_ex__, METH_O, __pyx_doc_7pyarrow_3lib_6Buffer_14__reduce_ex__},
  {"to_pybytes", (PyCFunction)__pyx_pw_7pyarrow_3lib_6Buffer_17to_pybytes, METH_NOARGS, __pyx_doc_7pyarrow_3lib_6Buffer_16to_pybytes},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_Buffer[] = {
  {(char *)"size", __pyx_getprop_7pyarrow_3lib_6Buffer_size, 0, (char *)0, 0},
  {(char *)"address", __pyx_getprop_7pyarrow_3lib_6Buffer_address, 0, (char *)0, 0},
  {(char *)"is_mutable", __pyx_getprop_7pyarrow_3lib_6Buffer_is_mutable, 0, (char *)0, 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_7__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Buffer = {
  #if PY_MAJOR_VERSION < 3
  __pyx_pw_7pyarrow_3lib_6Buffer_23__getreadbuffer__, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_pw_7pyarrow_3lib_6Buffer_25__getwritebuffer__, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  __pyx_pw_7pyarrow_3lib_6Buffer_21__getsegcount__, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  __pyx_pw_7pyarrow_3lib_6Buffer_19__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*/
  0, /*tp_print*/
  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()", /*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
};
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*/
  0, /*tp_print*/
  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_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
};
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->rd_file)) std::shared_ptr<arrow::io::RandomAccessFile> ();
  new((void*)&(p->wr_file)) 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->rd_file);
  __Pyx_call_destructor(p->wr_file);
  (*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_51__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_7pyarrow_3lib_10NativeFile_51__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},
  {"flush", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_21flush, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_20flush},
  {"_assert_open", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_23_assert_open, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_22_assert_open},
  {"_assert_readable", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_25_assert_readable, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_24_assert_readable},
  {"_assert_writable", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_27_assert_writable, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_26_assert_writable},
  {"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},
  {"write", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_35write, METH_O, __pyx_doc_7pyarrow_3lib_10NativeFile_34write},
  {"read", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_37read, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_36read},
  {"read1", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_39read1, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_38read1},
  {"readall", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_41readall, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_40readall},
  {"readinto", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_43readinto, METH_O, __pyx_doc_7pyarrow_3lib_10NativeFile_42readinto},
  {"readline", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_45readline, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_44readline},
  {"readlines", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_47readlines, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_46readlines},
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_7pyarrow_3lib_10NativeFile_51__next__, METH_NOARGS|METH_COEXIST, 0},
  {"read_buffer", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_53read_buffer, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_52read_buffer},
  {"truncate", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_55truncate, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_54truncate},
  {"writelines", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_57writelines, METH_O, __pyx_doc_7pyarrow_3lib_10NativeFile_56writelines},
  {"download", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_59download, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_58download},
  {"upload", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_10NativeFile_61upload, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_10NativeFile_60upload},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_63__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_10NativeFile_62__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_10NativeFile_65__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_10NativeFile_64__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*/
  0, /*tp_print*/
  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*/
  __pyx_pw_7pyarrow_3lib_10NativeFile_49__iter__, /*tp_iter*/
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__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
};
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> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

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_5__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_17LoggingMemoryPool_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_17LoggingMemoryPool_7__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_17LoggingMemoryPool_6__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*/
  0, /*tp_print*/
  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
};
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*/
  0, /*tp_print*/
  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    Derived MemoryPool class that tracks the number of bytes and\n    maximum memory allocated through its direct calls.\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
};
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 PyObject *__pyx_getprop_7pyarrow_3lib_10StructType_num_children(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_10StructType_12num_children_1__get__(o);
}

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 struct PyGetSetDef __pyx_getsets_7pyarrow_3lib_StructType[] = {
  {(char *)"num_children", __pyx_getprop_7pyarrow_3lib_10StructType_num_children, 0, (char *)0, 0},
  {0, 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*/
  0, /*tp_print*/
  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*/
  0, /*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*/
  __pyx_getsets_7pyarrow_3lib_StructType, /*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
};
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_num_children(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_9UnionType_12num_children_1__get__(o);
}

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 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 *)"num_children", __pyx_getprop_7pyarrow_3lib_9UnionType_num_children, 0, (char *)0, 0},
  {(char *)"mode", __pyx_getprop_7pyarrow_3lib_9UnionType_mode, 0, (char *)0, 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*/
  0, /*tp_print*/
  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*/
  0, /*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
};

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 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_7__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_8NullType_6__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_8NullType_9__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_8NullType_8__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*/
  0, /*tp_print*/
  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    Null (NA) value singleton\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_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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11BinaryValue_3__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_11BinaryValue_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_11BinaryValue_5__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_11BinaryValue_4__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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};
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 *)0, 0},
  {(char *)"dictionary_value", __pyx_getprop_7pyarrow_3lib_15DictionaryValue_dictionary_value, 0, (char *)0, 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*/
  0, /*tp_print*/
  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*/
  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*/
  __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
};

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*/
  0, /*tp_print*/
  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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};
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*/
  0, /*tp_print*/
  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_22__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_26__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*/
  0, /*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_19__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
};

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*/
  0, /*tp_print*/
  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
};
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*/
  0, /*tp_print*/
  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_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_49__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__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
};
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*/
  0, /*tp_print*/
  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    Supports 'r', 'r+w', '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_49__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__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
};
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*/
  0, /*tp_print*/
  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    Supports 'r', 'w' modes\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_49__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__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
};
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*/
  0, /*tp_print*/
  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_49__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__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
};
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*/
  0, /*tp_print*/
  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_49__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__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
};
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*/
  0, /*tp_print*/
  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_49__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__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
};
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*/
  0, /*tp_print*/
  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_49__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__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
};
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 = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->user = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->kerb_ticket = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->driver = ((PyObject*)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->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->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*/
  0, /*tp_print*/
  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
};

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*/
  0, /*tp_print*/
  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
};
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*/
  0, /*tp_print*/
  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_49__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7pyarrow_3lib_10NativeFile_51__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
};

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*/
  0, /*tp_print*/
  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
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchWriter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *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__RecordBatchWriter *)o);
  new((void*)&(p->writer)) std::shared_ptr< arrow::ipc::RecordBatchWriter> ();
  new((void*)&(p->sink)) std::shared_ptr<arrow::io::OutputStream> ();
  if (unlikely(__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_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__RecordBatchWriter(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter *)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_18_RecordBatchWriter_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __Pyx_call_destructor(p->writer);
  __Pyx_call_destructor(p->sink);
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__RecordBatchWriter[] = {
  {"_open", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_5_open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18_RecordBatchWriter_4_open},
  {"write", (PyCFunction)__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_7write, METH_O, __pyx_doc_7pyarrow_3lib_18_RecordBatchWriter_6write},
  {"write_batch", (PyCFunction)__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_9write_batch, METH_O, __pyx_doc_7pyarrow_3lib_18_RecordBatchWriter_8write_batch},
  {"write_table", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_11write_table, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_18_RecordBatchWriter_10write_table},
  {"close", (PyCFunction)__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_13close, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18_RecordBatchWriter_12close},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_15__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18_RecordBatchWriter_14__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18_RecordBatchWriter_17__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_18_RecordBatchWriter_16__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__RecordBatchWriter = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._RecordBatchWriter", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__RecordBatchWriter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchWriter, /*tp_dealloc*/
  0, /*tp_print*/
  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__RecordBatchWriter, /*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__RecordBatchWriter, /*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
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchReader(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *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__RecordBatchReader *)o);
  new((void*)&(p->reader)) std::shared_ptr< arrow::ipc::RecordBatchReader> ();
  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_18_RecordBatchReader_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__RecordBatchReader(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *)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->in_stream);
  Py_CLEAR(p->schema);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7pyarrow_3lib__RecordBatchReader(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *)o;
  if (p->schema) {
    e = (*v)(((PyObject *)p->schema), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7pyarrow_3lib__RecordBatchReader(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *p = (struct __pyx_obj_7pyarrow_3lib__RecordBatchReader *)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_18_RecordBatchReader_schema(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7pyarrow_3lib_18_RecordBatchReader_6schema_1__get__(o);
}

static PyMethodDef __pyx_methods_7pyarrow_3lib__RecordBatchReader[] = {
  {"_open", (PyCFunction)__pyx_pw_7pyarrow_3lib_18_RecordBatchReader_3_open, METH_O, __pyx_doc_7pyarrow_3lib_18_RecordBatchReader_2_open},
  {"get_next_batch", (PyCFunction)__pyx_pw_7pyarrow_3lib_18_RecordBatchReader_8get_next_batch, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18_RecordBatchReader_7get_next_batch},
  {"read_next_batch", (PyCFunction)__pyx_pw_7pyarrow_3lib_18_RecordBatchReader_10read_next_batch, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18_RecordBatchReader_9read_next_batch},
  {"read_all", (PyCFunction)__pyx_pw_7pyarrow_3lib_18_RecordBatchReader_12read_all, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18_RecordBatchReader_11read_all},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18_RecordBatchReader_14__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_18_RecordBatchReader_13__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_18_RecordBatchReader_16__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_18_RecordBatchReader_15__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7pyarrow_3lib__RecordBatchReader[] = {
  {(char *)"schema", __pyx_getprop_7pyarrow_3lib_18_RecordBatchReader_schema, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7pyarrow_3lib__RecordBatchReader = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib._RecordBatchReader", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib__RecordBatchReader), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib__RecordBatchReader, /*tp_dealloc*/
  0, /*tp_print*/
  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__RecordBatchReader, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib__RecordBatchReader, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7pyarrow_3lib_18_RecordBatchReader_5__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7pyarrow_3lib__RecordBatchReader, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7pyarrow_3lib__RecordBatchReader, /*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__RecordBatchReader, /*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
};

static PyObject *__pyx_tp_new_7pyarrow_3lib__RecordBatchFileWriter(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_tp_new_7pyarrow_3lib__RecordBatchWriter(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__RecordBatchWriter, /*tp_dealloc*/
  0, /*tp_print*/
  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
};

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},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_9__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_22_RecordBatchFileReader_11__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_22_RecordBatchFileReader_10__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*/
  0, /*tp_print*/
  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
};

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*/
  0, /*tp_print*/
  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
};

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},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_9__reduce_cython__, METH_NOARGS, __pyx_doc_7pyarrow_3lib_13FeatherReader_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_7pyarrow_3lib_13FeatherReader_11__setstate_cython__, METH_O, __pyx_doc_7pyarrow_3lib_13FeatherReader_10__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*/
  0, /*tp_print*/
  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
};

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*/
  0, /*tp_print*/
  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
};
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*/
  0, /*tp_print*/
  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
};

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*/
  0, /*tp_print*/
  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
};

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*/
  0, /*tp_print*/
  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
};

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*/
  0, /*tp_print*/
  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
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_3___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_3___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_3___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_3___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___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_3___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_3___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_3___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_3___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___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_3___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_3___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_3___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_3___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  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___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_3___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
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_4___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_4___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_4___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_4___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_4___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_4___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___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_4___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_4___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_4___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_4___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_4___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___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_4___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_4___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_4___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_4___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  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___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_4___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
};

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_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_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_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_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*/
  0, /*tp_print*/
  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
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6_iterchunks *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_6_iterchunks[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_6_iterchunks = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_6_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_6_iterchunks > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6_iterchunks)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_6_iterchunks[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_6_iterchunks];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6_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_6_iterchunks(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6_iterchunks *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6_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_6_iterchunks < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6_iterchunks)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_6_iterchunks[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_6_iterchunks++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6_iterchunks *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_6_iterchunks(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6_iterchunks *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6_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_6_iterchunks = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_6_iterchunks", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_6_iterchunks), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_6_iterchunks, /*tp_dealloc*/
  0, /*tp_print*/
  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_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_6_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
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_itercolumns *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_7_itercolumns[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_7_itercolumns = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_7_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_7_itercolumns > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_itercolumns)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_7_itercolumns[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_7_itercolumns];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_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_7_itercolumns(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_itercolumns *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_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_7_itercolumns < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_itercolumns)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_7_itercolumns[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_7_itercolumns++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_itercolumns *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_7_itercolumns(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_itercolumns *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_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_7_itercolumns = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_7_itercolumns", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_7_itercolumns), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_7_itercolumns, /*tp_dealloc*/
  0, /*tp_print*/
  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_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_7_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
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_download *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_8_download[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_8_download = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_8_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_8_download > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_download)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_8_download[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_8_download];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_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_8_download(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_download *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_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_8_download < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_download)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_8_download[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_8_download++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_download *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_8_download(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_download *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_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_8_download(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_download *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_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_8_download = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_8_download", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_8_download), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_8_download, /*tp_dealloc*/
  0, /*tp_print*/
  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_download, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_8_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_8_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
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_upload *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_9_upload[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_9_upload = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_9_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_9_upload > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_upload)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_9_upload[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_9_upload];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_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_9_upload(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_upload *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_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_9_upload < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_upload)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_9_upload[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_9_upload++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_upload *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_9_upload(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_upload *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_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_9_upload(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_upload *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_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_9_upload = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_9_upload", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_9_upload), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_9_upload, /*tp_dealloc*/
  0, /*tp_print*/
  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_upload, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_9_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_9_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
};

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_self);
  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_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), 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*/
  0, /*tp_print*/
  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
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11___iter__ *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_11___iter__[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_11___iter__ = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_11___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_11___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11___iter__)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_11___iter__[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_11___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11___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_11___iter__(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11___iter__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_11___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11___iter__)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_11___iter__[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_11___iter__++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_11___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11___iter__ *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11___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_11___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_11___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_11___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_11___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  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___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_11___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
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_12_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_12_is_named_tuple > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_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_12_is_named_tuple(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_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_12_is_named_tuple < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_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_12_is_named_tuple(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_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_12_is_named_tuple = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_12_is_named_tuple", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple, /*tp_dealloc*/
  0, /*tp_print*/
  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_is_named_tuple, /*tp_traverse*/
  __pyx_tp_clear_7pyarrow_3lib___pyx_scope_struct_12_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_12_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
};

static struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_genexpr *__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_13_genexpr[8];
static int __pyx_freecount_7pyarrow_3lib___pyx_scope_struct_13_genexpr = 0;

static PyObject *__pyx_tp_new_7pyarrow_3lib___pyx_scope_struct_13_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_13_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7pyarrow_3lib___pyx_scope_struct_13_genexpr[--__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_13_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_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_13_genexpr(PyObject *o) {
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_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_13_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_genexpr)))) {
    __pyx_freelist_7pyarrow_3lib___pyx_scope_struct_13_genexpr[__pyx_freecount_7pyarrow_3lib___pyx_scope_struct_13_genexpr++] = ((struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7pyarrow_3lib___pyx_scope_struct_13_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_genexpr *p = (struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_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_13_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyarrow.lib.__pyx_scope_struct_13_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7pyarrow_3lib___pyx_scope_struct_13_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7pyarrow_3lib___pyx_scope_struct_13_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  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_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_13_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
};

static PyMethodDef __pyx_methods[] = {
  {"decimal128", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_59decimal128, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_58decimal128},
  {"list_", (PyCFunction)__pyx_pw_7pyarrow_3lib_65list_, METH_O, __pyx_doc_7pyarrow_3lib_64list_},
  {"dictionary", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7pyarrow_3lib_67dictionary, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7pyarrow_3lib_66dictionary},
  {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_s_02d_02d, __pyx_k_02d_02d, sizeof(__pyx_k_02d_02d), 0, 0, 1, 0},
  {&__pyx_kp_s_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, 0, 1, 0},
  {&__pyx_kp_s_0_1, __pyx_k_0_1, sizeof(__pyx_k_0_1), 0, 0, 1, 0},
  {&__pyx_kp_s_0___class_____name___0, __pyx_k_0___class_____name___0, sizeof(__pyx_k_0___class_____name___0), 0, 0, 1, 0},
  {&__pyx_kp_s_All_arrays_must_have_the_same_le, __pyx_k_All_arrays_must_have_the_same_le, sizeof(__pyx_k_All_arrays_must_have_the_same_le), 0, 0, 1, 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_360, __pyx_k_Array_cast_line_360, sizeof(__pyx_k_Array_cast_line_360), 0, 1, 0, 0},
  {&__pyx_kp_s_Array_data_type_was_NULL, __pyx_k_Array_data_type_was_NULL, sizeof(__pyx_k_Array_data_type_was_NULL), 0, 0, 1, 0},
  {&__pyx_kp_s_Array_was_NULL, __pyx_k_Array_was_NULL, sizeof(__pyx_k_Array_was_NULL), 0, 0, 1, 0},
  {&__pyx_kp_s_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, 0, 1, 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_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_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_kp_s_Batch_number_0_out_of_range, __pyx_k_Batch_number_0_out_of_range, sizeof(__pyx_k_Batch_number_0_out_of_range), 0, 0, 1, 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_n_s_BufferedIOBase, __pyx_k_BufferedIOBase, sizeof(__pyx_k_BufferedIOBase), 0, 0, 1, 1},
  {&__pyx_kp_s_CPU_count_must_be_strictly_posit, __pyx_k_CPU_count_must_be_strictly_posit, sizeof(__pyx_k_CPU_count_must_be_strictly_posit), 0, 0, 1, 0},
  {&__pyx_kp_s_Cannot_compare_Arrow_values_that, __pyx_k_Cannot_compare_Arrow_values_that, sizeof(__pyx_k_Cannot_compare_Arrow_values_that), 0, 0, 1, 0},
  {&__pyx_kp_s_Cannot_construct_a_chunked_array, __pyx_k_Cannot_construct_a_chunked_array, sizeof(__pyx_k_Cannot_construct_a_chunked_array), 0, 0, 1, 0},
  {&__pyx_kp_s_Cannot_convert_nanosecond_timest, __pyx_k_Cannot_convert_nanosecond_timest, sizeof(__pyx_k_Cannot_convert_nanosecond_timest), 0, 0, 1, 0},
  {&__pyx_kp_s_Cannot_create_multiple_NAType_in, __pyx_k_Cannot_create_multiple_NAType_in, sizeof(__pyx_k_Cannot_create_multiple_NAType_in), 0, 0, 1, 0},
  {&__pyx_kp_s_Cannot_pass_schema_and_arrays, __pyx_k_Cannot_pass_schema_and_arrays, sizeof(__pyx_k_Cannot_pass_schema_and_arrays), 0, 0, 1, 0},
  {&__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_s_Chunk_index_out_of_range, __pyx_k_Chunk_index_out_of_range, sizeof(__pyx_k_Chunk_index_out_of_range), 0, 0, 1, 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_s_ChunkedArray_data_type_was_NULL, __pyx_k_ChunkedArray_data_type_was_NULL, sizeof(__pyx_k_ChunkedArray_data_type_was_NULL), 0, 0, 1, 0},
  {&__pyx_n_s_ChunkedArray_iterchunks, __pyx_k_ChunkedArray_iterchunks, sizeof(__pyx_k_ChunkedArray_iterchunks), 0, 0, 1, 1},
  {&__pyx_kp_s_ChunkedArray_was_NULL, __pyx_k_ChunkedArray_was_NULL, sizeof(__pyx_k_ChunkedArray_was_NULL), 0, 0, 1, 0},
  {&__pyx_n_s_Column, __pyx_k_Column, sizeof(__pyx_k_Column), 0, 0, 1, 1},
  {&__pyx_kp_s_Column_does_not_exist_in_table, __pyx_k_Column_does_not_exist_in_table, sizeof(__pyx_k_Column_does_not_exist_in_table), 0, 0, 1, 0},
  {&__pyx_kp_s_Column_name_0_r_type_1_r, __pyx_k_Column_name_0_r_type_1_r, sizeof(__pyx_k_Column_name_0_r_type_1_r), 0, 0, 1, 0},
  {&__pyx_kp_s_Column_r_not_found, __pyx_k_Column_r_not_found, sizeof(__pyx_k_Column_r_not_found), 0, 0, 1, 0},
  {&__pyx_kp_s_Comparisons_with_pyarrow_Array_a, __pyx_k_Comparisons_with_pyarrow_Array_a, sizeof(__pyx_k_Comparisons_with_pyarrow_Array_a), 0, 0, 1, 0},
  {&__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_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_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_n_s_DictionaryArray, __pyx_k_DictionaryArray, sizeof(__pyx_k_DictionaryArray), 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_s_Do_not_call_Buffer_s_constructor, __pyx_k_Do_not_call_Buffer_s_constructor, sizeof(__pyx_k_Do_not_call_Buffer_s_constructor), 0, 0, 1, 0},
  {&__pyx_kp_s_Do_not_call_ChunkedArray_s_const, __pyx_k_Do_not_call_ChunkedArray_s_const, sizeof(__pyx_k_Do_not_call_ChunkedArray_s_const), 0, 0, 1, 0},
  {&__pyx_kp_s_Do_not_call_Column_s_constructor, __pyx_k_Do_not_call_Column_s_constructor, sizeof(__pyx_k_Do_not_call_Column_s_constructor), 0, 0, 1, 0},
  {&__pyx_kp_s_Do_not_call_Field_s_constructor, __pyx_k_Do_not_call_Field_s_constructor, sizeof(__pyx_k_Do_not_call_Field_s_constructor), 0, 0, 1, 0},
  {&__pyx_kp_s_Do_not_call_RecordBatch_s_constr, __pyx_k_Do_not_call_RecordBatch_s_constr, sizeof(__pyx_k_Do_not_call_RecordBatch_s_constr), 0, 0, 1, 0},
  {&__pyx_kp_s_Do_not_call_Schema_s_constructor, __pyx_k_Do_not_call_Schema_s_constructor, sizeof(__pyx_k_Do_not_call_Schema_s_constructor), 0, 0, 1, 0},
  {&__pyx_kp_s_Do_not_call_Table_s_constructor, __pyx_k_Do_not_call_Table_s_constructor, sizeof(__pyx_k_Do_not_call_Table_s_constructor), 0, 0, 1, 0},
  {&__pyx_kp_s_Do_not_call_Tensor_s_constructor, __pyx_k_Do_not_call_Tensor_s_constructor, sizeof(__pyx_k_Do_not_call_Tensor_s_constructor), 0, 0, 1, 0},
  {&__pyx_kp_s_Do_not_call_s_constructor_direct, __pyx_k_Do_not_call_s_constructor_direct, sizeof(__pyx_k_Do_not_call_s_constructor_direct), 0, 0, 1, 0},
  {&__pyx_kp_s_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, 0, 1, 0},
  {&__pyx_kp_s_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, 0, 1, 0},
  {&__pyx_kp_s_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, 0, 1, 0},
  {&__pyx_kp_s_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, 0, 1, 0},
  {&__pyx_kp_s_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, 0, 1, 0},
  {&__pyx_kp_s_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, 0, 1, 0},
  {&__pyx_n_s_DoubleArray, __pyx_k_DoubleArray, sizeof(__pyx_k_DoubleArray), 0, 0, 1, 1},
  {&__pyx_n_s_DoubleValue, __pyx_k_DoubleValue, sizeof(__pyx_k_DoubleValue), 0, 0, 1, 1},
  {&__pyx_n_s_Empty, __pyx_k_Empty, sizeof(__pyx_k_Empty), 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_s_Failed_to_allocate_0_bytes, __pyx_k_Failed_to_allocate_0_bytes, sizeof(__pyx_k_Failed_to_allocate_0_bytes), 0, 0, 1, 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_s_File_object_is_malformed_has_no, __pyx_k_File_object_is_malformed_has_no, sizeof(__pyx_k_File_object_is_malformed_has_no), 0, 0, 1, 0},
  {&__pyx_n_s_FixedOffset, __pyx_k_FixedOffset, sizeof(__pyx_k_FixedOffset), 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_FloatArray, __pyx_k_FloatArray, sizeof(__pyx_k_FloatArray), 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_s_HDFS_client_improperly_initializ, __pyx_k_HDFS_client_improperly_initializ, sizeof(__pyx_k_HDFS_client_improperly_initializ), 0, 0, 1, 0},
  {&__pyx_kp_s_HDFS_client_is_closed, __pyx_k_HDFS_client_is_closed, sizeof(__pyx_k_HDFS_client_is_closed), 0, 0, 1, 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_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
  {&__pyx_kp_s_I_O_operation_on_closed_file, __pyx_k_I_O_operation_on_closed_file, sizeof(__pyx_k_I_O_operation_on_closed_file), 0, 0, 1, 0},
  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  {&__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_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_s_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, 0, 1, 0},
  {&__pyx_kp_s_Indices_must_be_integer_type, __pyx_k_Indices_must_be_integer_type, sizeof(__pyx_k_Indices_must_be_integer_type), 0, 0, 1, 0},
  {&__pyx_n_s_Int16Array, __pyx_k_Int16Array, sizeof(__pyx_k_Int16Array), 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_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_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_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_kp_s_Invalid_TimeUnit_for_time32, __pyx_k_Invalid_TimeUnit_for_time32, sizeof(__pyx_k_Invalid_TimeUnit_for_time32), 0, 0, 1, 0},
  {&__pyx_kp_s_Invalid_TimeUnit_for_time64, __pyx_k_Invalid_TimeUnit_for_time64, sizeof(__pyx_k_Invalid_TimeUnit_for_time64), 0, 0, 1, 0},
  {&__pyx_kp_s_Invalid_TimeUnit_string, __pyx_k_Invalid_TimeUnit_string, sizeof(__pyx_k_Invalid_TimeUnit_string), 0, 0, 1, 0},
  {&__pyx_kp_s_Invalid_comparison, __pyx_k_Invalid_comparison, sizeof(__pyx_k_Invalid_comparison), 0, 0, 1, 0},
  {&__pyx_kp_s_Invalid_file_mode_0, __pyx_k_Invalid_file_mode_0, sizeof(__pyx_k_Invalid_file_mode_0), 0, 0, 1, 0},
  {&__pyx_kp_s_Invalid_union_mode_0_r, __pyx_k_Invalid_union_mode_0_r, sizeof(__pyx_k_Invalid_union_mode_0_r), 0, 0, 1, 0},
  {&__pyx_kp_s_Invalid_value_of_whence_0, __pyx_k_Invalid_value_of_whence_0, sizeof(__pyx_k_Invalid_value_of_whence_0), 0, 0, 1, 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_kp_s_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, 0, 1, 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_s_List_requires_DataType_or_Field, __pyx_k_List_requires_DataType_or_Field, sizeof(__pyx_k_List_requires_DataType_or_Field), 0, 0, 1, 0},
  {&__pyx_n_s_LoggingMemoryPool, __pyx_k_LoggingMemoryPool, sizeof(__pyx_k_LoggingMemoryPool), 0, 0, 1, 1},
  {&__pyx_n_s_Mapping, __pyx_k_Mapping, sizeof(__pyx_k_Mapping), 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_n_s_MockOutputStream, __pyx_k_MockOutputStream, sizeof(__pyx_k_MockOutputStream), 0, 0, 1, 1},
  {&__pyx_kp_s_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, 0, 1, 0},
  {&__pyx_kp_s_Must_pass_decompressed_size_for, __pyx_k_Must_pass_decompressed_size_for, sizeof(__pyx_k_Must_pass_decompressed_size_for), 0, 0, 1, 0},
  {&__pyx_kp_s_Must_pass_names_when_constructin, __pyx_k_Must_pass_names_when_constructin, sizeof(__pyx_k_Must_pass_names_when_constructin), 0, 0, 1, 0},
  {&__pyx_kp_s_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, 0, 1, 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_s_NULL, __pyx_k_NULL, sizeof(__pyx_k_NULL), 0, 0, 1, 1},
  {&__pyx_n_s_NULL_2, __pyx_k_NULL_2, sizeof(__pyx_k_NULL_2), 0, 0, 1, 1},
  {&__pyx_kp_s_Names_are_currently_required, __pyx_k_Names_are_currently_required, sizeof(__pyx_k_Names_are_currently_required), 0, 0, 1, 0},
  {&__pyx_n_s_NativeFile, __pyx_k_NativeFile, sizeof(__pyx_k_NativeFile), 0, 0, 1, 1},
  {&__pyx_kp_s_Native_file_is_not_readable, __pyx_k_Native_file_is_not_readable, sizeof(__pyx_k_Native_file_is_not_readable), 0, 0, 1, 0},
  {&__pyx_kp_s_Native_file_is_not_writable, __pyx_k_Native_file_is_not_writable, sizeof(__pyx_k_Native_file_is_not_writable), 0, 0, 1, 0},
  {&__pyx_kp_s_No_type_alias_for_0, __pyx_k_No_type_alias_for_0, sizeof(__pyx_k_No_type_alias_for_0), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at, __pyx_k_No_value_specified_for_struct_at, sizeof(__pyx_k_No_value_specified_for_struct_at), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_2, __pyx_k_No_value_specified_for_struct_at_2, sizeof(__pyx_k_No_value_specified_for_struct_at_2), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_3, __pyx_k_No_value_specified_for_struct_at_3, sizeof(__pyx_k_No_value_specified_for_struct_at_3), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_4, __pyx_k_No_value_specified_for_struct_at_4, sizeof(__pyx_k_No_value_specified_for_struct_at_4), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_5, __pyx_k_No_value_specified_for_struct_at_5, sizeof(__pyx_k_No_value_specified_for_struct_at_5), 0, 0, 1, 0},
  {&__pyx_kp_s_Non_fixed_width_type, __pyx_k_Non_fixed_width_type, sizeof(__pyx_k_Non_fixed_width_type), 0, 0, 1, 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_kp_s_NumPy_array_view_is_only_support, __pyx_k_NumPy_array_view_is_only_support, sizeof(__pyx_k_NumPy_array_view_is_only_support), 0, 0, 1, 0},
  {&__pyx_kp_s_NumPy_array_view_is_only_support_2, __pyx_k_NumPy_array_view_is_only_support_2, sizeof(__pyx_k_NumPy_array_view_is_only_support_2), 0, 0, 1, 0},
  {&__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_s_Offset_must_be_non_negative, __pyx_k_Offset_must_be_non_negative, sizeof(__pyx_k_Offset_must_be_non_negative), 0, 0, 1, 0},
  {&__pyx_n_s_OrderedDict, __pyx_k_OrderedDict, sizeof(__pyx_k_OrderedDict), 0, 0, 1, 1},
  {&__pyx_n_s_PandasSeries, __pyx_k_PandasSeries, sizeof(__pyx_k_PandasSeries), 0, 0, 1, 1},
  {&__pyx_kp_s_Passed_field_type_does_not_match, __pyx_k_Passed_field_type_does_not_match, sizeof(__pyx_k_Passed_field_type_does_not_match), 0, 0, 1, 0},
  {&__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_n_s_PlasmaObjectExists, __pyx_k_PlasmaObjectExists, sizeof(__pyx_k_PlasmaObjectExists), 0, 0, 1, 1},
  {&__pyx_n_s_PlasmaObjectNonexistent, __pyx_k_PlasmaObjectNonexistent, sizeof(__pyx_k_PlasmaObjectNonexistent), 0, 0, 1, 1},
  {&__pyx_n_s_PlasmaStoreFull, __pyx_k_PlasmaStoreFull, sizeof(__pyx_k_PlasmaStoreFull), 0, 0, 1, 1},
  {&__pyx_kp_s_Please_use_read_next_batch_inste, __pyx_k_Please_use_read_next_batch_inste, sizeof(__pyx_k_Please_use_read_next_batch_inste), 0, 0, 1, 0},
  {&__pyx_n_s_ProxyMemoryPool, __pyx_k_ProxyMemoryPool, sizeof(__pyx_k_ProxyMemoryPool), 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_RecordBatchReader, __pyx_k_RecordBatchReader, sizeof(__pyx_k_RecordBatchReader), 0, 0, 1, 1},
  {&__pyx_n_s_RecordBatchReader___iter, __pyx_k_RecordBatchReader___iter, sizeof(__pyx_k_RecordBatchReader___iter), 0, 0, 1, 1},
  {&__pyx_n_s_RecordBatchWriter, __pyx_k_RecordBatchWriter, sizeof(__pyx_k_RecordBatchWriter), 0, 0, 1, 1},
  {&__pyx_kp_s_Record_batch_column_index_d_is_o, __pyx_k_Record_batch_column_index_d_is_o, sizeof(__pyx_k_Record_batch_column_index_d_is_o), 0, 0, 1, 0},
  {&__pyx_n_s_ResizableBuffer, __pyx_k_ResizableBuffer, sizeof(__pyx_k_ResizableBuffer), 0, 0, 1, 1},
  {&__pyx_n_s_Scalar, __pyx_k_Scalar, sizeof(__pyx_k_Scalar), 0, 0, 1, 1},
  {&__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_s_Schema_and_number_of_arrays_uneq, __pyx_k_Schema_and_number_of_arrays_uneq, sizeof(__pyx_k_Schema_and_number_of_arrays_uneq), 0, 0, 1, 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_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_s_StringBuilder_only_accepts_strin, __pyx_k_StringBuilder_only_accepts_strin, sizeof(__pyx_k_StringBuilder_only_accepts_strin), 0, 0, 1, 0},
  {&__pyx_n_s_StringIO, __pyx_k_StringIO, sizeof(__pyx_k_StringIO), 0, 0, 1, 1},
  {&__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_n_s_SystemError, __pyx_k_SystemError, sizeof(__pyx_k_SystemError), 0, 0, 1, 1},
  {&__pyx_n_s_Table, __pyx_k_Table, sizeof(__pyx_k_Table), 0, 0, 1, 1},
  {&__pyx_kp_s_Table_column_index_d_is_out_of_r, __pyx_k_Table_column_index_d_is_out_of_r, sizeof(__pyx_k_Table_column_index_d_is_out_of_r), 0, 0, 1, 0},
  {&__pyx_kp_u_Table_from_pandas_line_1166, __pyx_k_Table_from_pandas_line_1166, sizeof(__pyx_k_Table_from_pandas_line_1166), 0, 1, 0, 0},
  {&__pyx_n_s_Table_itercolumns, __pyx_k_Table_itercolumns, sizeof(__pyx_k_Table_itercolumns), 0, 0, 1, 1},
  {&__pyx_kp_s_Target_schema_s_field_names_are, __pyx_k_Target_schema_s_field_names_are, sizeof(__pyx_k_Target_schema_s_field_names_are), 0, 0, 1, 0},
  {&__pyx_n_s_Tensor, __pyx_k_Tensor, sizeof(__pyx_k_Tensor), 0, 0, 1, 1},
  {&__pyx_kp_s_Tensor_was_NULL, __pyx_k_Tensor_was_NULL, sizeof(__pyx_k_Tensor_was_NULL), 0, 0, 1, 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_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_FIXED_SIZE_BINARY, __pyx_k_Type_FIXED_SIZE_BINARY, sizeof(__pyx_k_Type_FIXED_SIZE_BINARY), 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_s_Type_ID, __pyx_k_Type_ID, sizeof(__pyx_k_Type_ID), 0, 0, 1, 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_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_n_s_UInt16Array, __pyx_k_UInt16Array, sizeof(__pyx_k_UInt16Array), 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_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_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_UInt8Value, __pyx_k_UInt8Value, sizeof(__pyx_k_UInt8Value), 0, 0, 1, 1},
  {&__pyx_kp_s_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, 0, 1, 0},
  {&__pyx_kp_s_Unable_to_read_message_from_obje, __pyx_k_Unable_to_read_message_from_obje, sizeof(__pyx_k_Unable_to_read_message_from_obje), 0, 0, 1, 0},
  {&__pyx_kp_s_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, 0, 1, 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_kp_s_Unrecognized_compression_type_0, __pyx_k_Unrecognized_compression_type_0, sizeof(__pyx_k_Unrecognized_compression_type_0), 0, 0, 1, 0},
  {&__pyx_n_s_UnsupportedOperation, __pyx_k_UnsupportedOperation, sizeof(__pyx_k_UnsupportedOperation), 0, 0, 1, 1},
  {&__pyx_kp_s_Unsupported_type_for_column, __pyx_k_Unsupported_type_for_column, sizeof(__pyx_k_Unsupported_type_for_column), 0, 0, 1, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_kp_s_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, 0, 1, 0},
  {&__pyx_kp_s_Writable_buffer_requested_but_Ar, __pyx_k_Writable_buffer_requested_but_Ar, sizeof(__pyx_k_Writable_buffer_requested_but_Ar), 0, 0, 1, 0},
  {&__pyx_kp_s__103, __pyx_k__103, sizeof(__pyx_k__103), 0, 0, 1, 0},
  {&__pyx_kp_s__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 0, 1, 0},
  {&__pyx_kp_s__13, __pyx_k__13, sizeof(__pyx_k__13), 0, 0, 1, 0},
  {&__pyx_n_s__75, __pyx_k__75, sizeof(__pyx_k__75), 0, 0, 1, 1},
  {&__pyx_kp_b__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 0, 0},
  {&__pyx_n_s_ab, __pyx_k_ab, sizeof(__pyx_k_ab), 0, 0, 1, 1},
  {&__pyx_kp_s_accessing_non_existent_buffer_se, __pyx_k_accessing_non_existent_buffer_se, sizeof(__pyx_k_accessing_non_existent_buffer_se), 0, 0, 1, 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_append, __pyx_k_append, sizeof(__pyx_k_append), 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_arr_2, __pyx_k_arr_2, sizeof(__pyx_k_arr_2), 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_kp_u_array_line_87, __pyx_k_array_line_87, sizeof(__pyx_k_array_line_87), 0, 1, 0, 0},
  {&__pyx_n_s_arrays, __pyx_k_arrays, sizeof(__pyx_k_arrays), 0, 0, 1, 1},
  {&__pyx_kp_s_arrays_list_is_empty, __pyx_k_arrays_list_is_empty, sizeof(__pyx_k_arrays_list_is_empty), 0, 0, 1, 0},
  {&__pyx_n_s_arrow_obj, __pyx_k_arrow_obj, sizeof(__pyx_k_arrow_obj), 0, 0, 1, 1},
  {&__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_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_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_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_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_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_s_block_size, __pyx_k_block_size, sizeof(__pyx_k_block_size), 0, 0, 1, 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_s_bool_2, __pyx_k_bool_2, sizeof(__pyx_k_bool_2), 0, 0, 1, 1},
  {&__pyx_n_s_boxed_field, __pyx_k_boxed_field, sizeof(__pyx_k_boxed_field), 0, 0, 1, 1},
  {&__pyx_n_s_brotli, __pyx_k_brotli, sizeof(__pyx_k_brotli), 0, 0, 1, 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_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_codec, __pyx_k_c_codec, sizeof(__pyx_k_c_codec), 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_meta, __pyx_k_c_meta, sizeof(__pyx_k_c_meta), 0, 0, 1, 1},
  {&__pyx_n_s_c_name, __pyx_k_c_name, sizeof(__pyx_k_c_name), 0, 0, 1, 1},
  {&__pyx_n_s_c_null_bitmap, __pyx_k_c_null_bitmap, sizeof(__pyx_k_c_null_bitmap), 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_result, __pyx_k_c_result, sizeof(__pyx_k_c_result), 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_size, __pyx_k_c_size, sizeof(__pyx_k_c_size), 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_carr, __pyx_k_carr, sizeof(__pyx_k_carr), 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_columns, __pyx_k_categorical_columns, sizeof(__pyx_k_categorical_columns), 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_s_chunksize, __pyx_k_chunksize, sizeof(__pyx_k_chunksize), 0, 0, 1, 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_s_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 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_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 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_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_compressor, __pyx_k_compressor, sizeof(__pyx_k_compressor), 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_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_kp_s_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, 0, 1, 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_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_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_s_cy_schema, __pyx_k_cy_schema, sizeof(__pyx_k_cy_schema), 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_s_dataframe_to_arrays, __pyx_k_dataframe_to_arrays, sizeof(__pyx_k_dataframe_to_arrays), 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_kp_s_date32_day, __pyx_k_date32_day, sizeof(__pyx_k_date32_day), 0, 0, 1, 0},
  {&__pyx_n_s_date64, __pyx_k_date64, sizeof(__pyx_k_date64), 0, 0, 1, 1},
  {&__pyx_kp_s_date64_ms, __pyx_k_date64_ms, sizeof(__pyx_k_date64_ms), 0, 0, 1, 0},
  {&__pyx_n_s_date_as_object, __pyx_k_date_as_object, sizeof(__pyx_k_date_as_object), 0, 0, 1, 1},
  {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
  {&__pyx_kp_s_datetime64_ns, __pyx_k_datetime64_ns, sizeof(__pyx_k_datetime64_ns), 0, 0, 1, 0},
  {&__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_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_default_block_size, __pyx_k_default_block_size, sizeof(__pyx_k_default_block_size), 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_s_dense, __pyx_k_dense, sizeof(__pyx_k_dense), 0, 0, 1, 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_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_s_dict_values, __pyx_k_dict_values, sizeof(__pyx_k_dict_values), 0, 0, 1, 1},
  {&__pyx_n_s_dictionary, __pyx_k_dictionary, sizeof(__pyx_k_dictionary), 0, 0, 1, 1},
  {&__pyx_n_s_dictionary_2, __pyx_k_dictionary_2, sizeof(__pyx_k_dictionary_2), 0, 0, 1, 1},
  {&__pyx_n_s_dictionary_encode, __pyx_k_dictionary_encode, sizeof(__pyx_k_dictionary_encode), 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_directory, __pyx_k_directory, sizeof(__pyx_k_directory), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 0, 0, 1, 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_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_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_type, __pyx_k_exc_type, sizeof(__pyx_k_exc_type), 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_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_s_f2, __pyx_k_f2, sizeof(__pyx_k_f2), 0, 0, 1, 1},
  {&__pyx_n_s_f4, __pyx_k_f4, sizeof(__pyx_k_f4), 0, 0, 1, 1},
  {&__pyx_n_s_f8, __pyx_k_f8, sizeof(__pyx_k_f8), 0, 0, 1, 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_or_name, __pyx_k_field_or_name, sizeof(__pyx_k_field_or_name), 0, 0, 1, 1},
  {&__pyx_n_s_fields, __pyx_k_fields, sizeof(__pyx_k_fields), 0, 0, 1, 1},
  {&__pyx_n_s_fields_2, __pyx_k_fields_2, sizeof(__pyx_k_fields_2), 0, 0, 1, 1},
  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 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_fixed_size_binary_type, __pyx_k_fixed_size_binary_type, sizeof(__pyx_k_fixed_size_binary_type), 0, 0, 1, 1},
  {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1},
  {&__pyx_n_s_float16, __pyx_k_float16, sizeof(__pyx_k_float16), 0, 0, 1, 1},
  {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1},
  {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 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_array, __pyx_k_from_array, sizeof(__pyx_k_from_array), 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_kp_s_from_buffers_is_only_supported_f, __pyx_k_from_buffers_is_only_supported_f, sizeof(__pyx_k_from_buffers_is_only_supported_f), 0, 0, 1, 0},
  {&__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_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_sparse, __pyx_k_from_sparse, sizeof(__pyx_k_from_sparse), 0, 0, 1, 1},
  {&__pyx_n_s_frombuffer, __pyx_k_frombuffer, sizeof(__pyx_k_frombuffer), 0, 0, 1, 1},
  {&__pyx_n_s_frombytes, __pyx_k_frombytes, sizeof(__pyx_k_frombytes), 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_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_getnewargs, __pyx_k_getnewargs, sizeof(__pyx_k_getnewargs), 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_n_s_group, __pyx_k_group, sizeof(__pyx_k_group), 0, 0, 1, 1},
  {&__pyx_n_s_gzip, __pyx_k_gzip, sizeof(__pyx_k_gzip), 0, 0, 1, 1},
  {&__pyx_n_b_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 0, 1},
  {&__pyx_n_s_halffloat, __pyx_k_halffloat, sizeof(__pyx_k_halffloat), 0, 0, 1, 1},
  {&__pyx_n_s_handle, __pyx_k_handle, sizeof(__pyx_k_handle), 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_kp_s_hdfs_d, __pyx_k_hdfs_d, sizeof(__pyx_k_hdfs_d), 0, 0, 1, 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_s_i1, __pyx_k_i1, sizeof(__pyx_k_i1), 0, 0, 1, 1},
  {&__pyx_n_s_i2, __pyx_k_i2, sizeof(__pyx_k_i2), 0, 0, 1, 1},
  {&__pyx_n_s_i4, __pyx_k_i4, sizeof(__pyx_k_i4), 0, 0, 1, 1},
  {&__pyx_n_s_i8, __pyx_k_i8, sizeof(__pyx_k_i8), 0, 0, 1, 1},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 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_s_index_out_of_bounds, __pyx_k_index_out_of_bounds, sizeof(__pyx_k_index_out_of_bounds), 0, 0, 1, 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_s_indices_2, __pyx_k_indices_2, sizeof(__pyx_k_indices_2), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 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_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
  {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
  {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1},
  {&__pyx_n_s_integer_object_nulls, __pyx_k_integer_object_nulls, sizeof(__pyx_k_integer_object_nulls), 0, 0, 1, 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_boolean_value, __pyx_k_is_boolean_value, sizeof(__pyx_k_is_boolean_value), 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_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_primitive, __pyx_k_is_primitive, sizeof(__pyx_k_is_primitive), 0, 0, 1, 1},
  {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 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_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_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_s_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, 0, 1, 0},
  {&__pyx_n_s_kind, __pyx_k_kind, sizeof(__pyx_k_kind), 0, 0, 1, 1},
  {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1},
  {&__pyx_n_s_last_access_time, __pyx_k_last_access_time, sizeof(__pyx_k_last_access_time), 0, 0, 1, 1},
  {&__pyx_n_s_last_accessed, __pyx_k_last_accessed, sizeof(__pyx_k_last_accessed), 0, 0, 1, 1},
  {&__pyx_n_s_last_modified, __pyx_k_last_modified, sizeof(__pyx_k_last_modified), 0, 0, 1, 1},
  {&__pyx_n_s_last_modified_time, __pyx_k_last_modified_time, sizeof(__pyx_k_last_modified_time), 0, 0, 1, 1},
  {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
  {&__pyx_n_s_libhdfs, __pyx_k_libhdfs, sizeof(__pyx_k_libhdfs), 0, 0, 1, 1},
  {&__pyx_n_s_libhdfs3, __pyx_k_libhdfs3, sizeof(__pyx_k_libhdfs3), 0, 0, 1, 1},
  {&__pyx_n_s_list, __pyx_k_list, sizeof(__pyx_k_list), 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_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
  {&__pyx_n_s_lz4, __pyx_k_lz4, sizeof(__pyx_k_lz4), 0, 0, 1, 1},
  {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 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_map, __pyx_k_map, sizeof(__pyx_k_map), 0, 0, 1, 1},
  {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},
  {&__pyx_kp_s_mask_not_implemented_with_Arrow, __pyx_k_mask_not_implemented_with_Arrow, sizeof(__pyx_k_mask_not_implemented_with_Arrow), 0, 0, 1, 0},
  {&__pyx_n_s_match, __pyx_k_match, sizeof(__pyx_k_match), 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_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_s_metadata_2, __pyx_k_metadata_2, sizeof(__pyx_k_metadata_2), 0, 0, 1, 0},
  {&__pyx_n_s_metadata_length, __pyx_k_metadata_length, sizeof(__pyx_k_metadata_length), 0, 0, 1, 1},
  {&__pyx_n_s_microseconds, __pyx_k_microseconds, sizeof(__pyx_k_microseconds), 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_minutes_2, __pyx_k_minutes_2, sizeof(__pyx_k_minutes_2), 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_s_ms, __pyx_k_ms, sizeof(__pyx_k_ms), 0, 0, 1, 1},
  {&__pyx_n_s_multiprocessing, __pyx_k_multiprocessing, sizeof(__pyx_k_multiprocessing), 0, 0, 1, 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_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 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_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_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_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_s_not_registered_in_deserializati, __pyx_k_not_registered_in_deserializati, sizeof(__pyx_k_not_registered_in_deserializati), 0, 0, 1, 0},
  {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  {&__pyx_n_s_ns, __pyx_k_ns, sizeof(__pyx_k_ns), 0, 0, 1, 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_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_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_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_tensors, __pyx_k_num_tensors, sizeof(__pyx_k_num_tensors), 0, 0, 1, 1},
  {&__pyx_n_s_number_of_arrays, __pyx_k_number_of_arrays, sizeof(__pyx_k_number_of_arrays), 0, 0, 1, 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_s_only_slices_with_step_1_supporte, __pyx_k_only_slices_with_step_1_supporte, sizeof(__pyx_k_only_slices_with_step_1_supporte), 0, 0, 1, 0},
  {&__pyx_kp_s_only_valid_on_readonly_files, __pyx_k_only_valid_on_readonly_files, sizeof(__pyx_k_only_valid_on_readonly_files), 0, 0, 1, 0},
  {&__pyx_kp_s_only_valid_on_writable_files, __pyx_k_only_valid_on_writable_files, sizeof(__pyx_k_only_valid_on_writable_files), 0, 0, 1, 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_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_owner, __pyx_k_owner, sizeof(__pyx_k_owner), 0, 0, 1, 1},
  {&__pyx_n_s_pa_getnewargs, __pyx_k_pa_getnewargs, sizeof(__pyx_k_pa_getnewargs), 0, 0, 1, 1},
  {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 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_s_pd, __pyx_k_pd, sizeof(__pyx_k_pd), 0, 0, 1, 1},
  {&__pyx_n_s_pdcompat, __pyx_k_pdcompat, sizeof(__pyx_k_pdcompat), 0, 0, 1, 1},
  {&__pyx_n_s_permissions, __pyx_k_permissions, sizeof(__pyx_k_permissions), 0, 0, 1, 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_s_pool, __pyx_k_pool, sizeof(__pyx_k_pool), 0, 0, 1, 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_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_preserve_index, __pyx_k_preserve_index, sizeof(__pyx_k_preserve_index), 0, 0, 1, 1},
  {&__pyx_kp_s_prior_column_had_a_different_num, __pyx_k_prior_column_had_a_different_num, sizeof(__pyx_k_prior_column_had_a_different_num), 0, 0, 1, 0},
  {&__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_s_pyarrow, __pyx_k_pyarrow, sizeof(__pyx_k_pyarrow), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_Field_0, __pyx_k_pyarrow_Field_0, sizeof(__pyx_k_pyarrow_Field_0), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_Message_type_0_metadata, __pyx_k_pyarrow_Message_type_0_metadata, sizeof(__pyx_k_pyarrow_Message_type_0_metadata), 0, 0, 1, 0},
  {&__pyx_kp_s_pyarrow_Tensor_type_0_type_shap, __pyx_k_pyarrow_Tensor_type_0_type_shap, sizeof(__pyx_k_pyarrow_Tensor_type_0_type_shap), 0, 0, 1, 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_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, 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_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_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_pytype, __pyx_k_pytype, sizeof(__pyx_k_pytype), 0, 0, 1, 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_SerializationCont, __pyx_k_pyx_unpickle_SerializationCont, sizeof(__pyx_k_pyx_unpickle_SerializationCont), 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_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
  {&__pyx_kp_s_r_2, __pyx_k_r_2, sizeof(__pyx_k_r_2), 0, 0, 1, 0},
  {&__pyx_kp_s_r_b, __pyx_k_r_b, sizeof(__pyx_k_r_b), 0, 0, 1, 0},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_kp_s_rb, __pyx_k_rb, sizeof(__pyx_k_rb), 0, 0, 1, 0},
  {&__pyx_n_s_rb_2, __pyx_k_rb_2, sizeof(__pyx_k_rb_2), 0, 0, 1, 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_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_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_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_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_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 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_rz_buffer, __pyx_k_rz_buffer, sizeof(__pyx_k_rz_buffer), 0, 0, 1, 1},
  {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 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_seconds, __pyx_k_seconds, sizeof(__pyx_k_seconds), 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_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_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_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_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_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_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_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_snappy, __pyx_k_snappy, sizeof(__pyx_k_snappy), 0, 0, 1, 1},
  {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 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_column, __pyx_k_sp_column, sizeof(__pyx_k_sp_column), 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_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_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
  {&__pyx_n_s_str_2, __pyx_k_str_2, sizeof(__pyx_k_str_2), 0, 0, 1, 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_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_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_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_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_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_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_s_time32_ms, __pyx_k_time32_ms, sizeof(__pyx_k_time32_ms), 0, 0, 1, 0},
  {&__pyx_kp_s_time32_s, __pyx_k_time32_s, sizeof(__pyx_k_time32_s), 0, 0, 1, 0},
  {&__pyx_n_s_time64, __pyx_k_time64, sizeof(__pyx_k_time64), 0, 0, 1, 1},
  {&__pyx_kp_s_time64_ns, __pyx_k_time64_ns, sizeof(__pyx_k_time64_ns), 0, 0, 1, 0},
  {&__pyx_kp_s_time64_us, __pyx_k_time64_us, sizeof(__pyx_k_time64_us), 0, 0, 1, 0},
  {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 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_s_timestamp_ms, __pyx_k_timestamp_ms, sizeof(__pyx_k_timestamp_ms), 0, 0, 1, 0},
  {&__pyx_kp_s_timestamp_ns, __pyx_k_timestamp_ns, sizeof(__pyx_k_timestamp_ns), 0, 0, 1, 0},
  {&__pyx_kp_s_timestamp_s, __pyx_k_timestamp_s, sizeof(__pyx_k_timestamp_s), 0, 0, 1, 0},
  {&__pyx_kp_s_timestamp_us, __pyx_k_timestamp_us, sizeof(__pyx_k_timestamp_us), 0, 0, 1, 0},
  {&__pyx_n_s_timezone, __pyx_k_timezone, sizeof(__pyx_k_timezone), 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_dtype, __pyx_k_to_pandas_dtype, sizeof(__pyx_k_to_pandas_dtype), 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_truncate, __pyx_k_truncate, sizeof(__pyx_k_truncate), 0, 0, 1, 1},
  {&__pyx_kp_s_trying_to_write_an_immutable_buf, __pyx_k_trying_to_write_an_immutable_buf, sizeof(__pyx_k_trying_to_write_an_immutable_buf), 0, 0, 1, 0},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_n_s_type_2, __pyx_k_type_2, sizeof(__pyx_k_type_2), 0, 0, 1, 1},
  {&__pyx_n_s_type_3, __pyx_k_type_3, sizeof(__pyx_k_type_3), 0, 0, 1, 1},
  {&__pyx_n_s_type_codes, __pyx_k_type_codes, sizeof(__pyx_k_type_codes), 0, 0, 1, 1},
  {&__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_kp_s_type_s_not_supported_for_buffer, __pyx_k_type_s_not_supported_for_buffer, sizeof(__pyx_k_type_s_not_supported_for_buffer), 0, 0, 1, 0},
  {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
  {&__pyx_n_s_tz, __pyx_k_tz, sizeof(__pyx_k_tz), 0, 0, 1, 1},
  {&__pyx_n_s_tz_convert, __pyx_k_tz_convert, sizeof(__pyx_k_tz_convert), 0, 0, 1, 1},
  {&__pyx_n_s_tz_localize, __pyx_k_tz_localize, sizeof(__pyx_k_tz_localize), 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_u1, __pyx_k_u1, sizeof(__pyx_k_u1), 0, 0, 1, 1},
  {&__pyx_n_s_u2, __pyx_k_u2, sizeof(__pyx_k_u2), 0, 0, 1, 1},
  {&__pyx_n_s_u4, __pyx_k_u4, sizeof(__pyx_k_u4), 0, 0, 1, 1},
  {&__pyx_n_s_u8, __pyx_k_u8, sizeof(__pyx_k_u8), 0, 0, 1, 1},
  {&__pyx_n_s_uint16, __pyx_k_uint16, sizeof(__pyx_k_uint16), 0, 0, 1, 1},
  {&__pyx_n_s_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 0, 1, 1},
  {&__pyx_n_s_uint64, __pyx_k_uint64, sizeof(__pyx_k_uint64), 0, 0, 1, 1},
  {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
  {&__pyx_n_s_uncompressed, __pyx_k_uncompressed, sizeof(__pyx_k_uncompressed), 0, 0, 1, 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_unique, __pyx_k_unique, sizeof(__pyx_k_unique), 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_s_unknown_driver_r, __pyx_k_unknown_driver_r, sizeof(__pyx_k_unknown_driver_r), 0, 0, 1, 0},
  {&__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_s_us, __pyx_k_us, sizeof(__pyx_k_us), 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_threads, __pyx_k_use_threads, sizeof(__pyx_k_use_threads), 0, 0, 1, 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_utcfromtimestamp, __pyx_k_utcfromtimestamp, sizeof(__pyx_k_utcfromtimestamp), 0, 0, 1, 1},
  {&__pyx_n_s_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 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_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 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_s_wb, __pyx_k_wb, sizeof(__pyx_k_wb), 0, 0, 1, 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_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_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 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_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_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_n_s_zstd, __pyx_k_zstd, sizeof(__pyx_k_zstd), 0, 0, 1, 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_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 35, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 39, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 43, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 47, __pyx_L1_error)
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 200, __pyx_L1_error)
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(2, 441, __pyx_L1_error)
  __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(3, 134, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(3, 215, __pyx_L1_error)
  __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(3, 985, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(3, 1334, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(1, 63, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(1, 317, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(1, 406, __pyx_L1_error)
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(2, 61, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 222, __pyx_L1_error)
  __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(4, 381, __pyx_L1_error)
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(4, 517, __pyx_L1_error)
  __pyx_builtin_BufferError = __Pyx_GetBuiltinName(__pyx_n_s_BufferError); if (!__pyx_builtin_BufferError) __PYX_ERR(4, 839, __pyx_L1_error)
  __pyx_builtin_SystemError = __Pyx_GetBuiltinName(__pyx_n_s_SystemError); if (!__pyx_builtin_SystemError) __PYX_ERR(4, 860, __pyx_L1_error)
  __pyx_builtin_FutureWarning = __Pyx_GetBuiltinName(__pyx_n_s_FutureWarning); if (!__pyx_builtin_FutureWarning) __PYX_ERR(5, 270, __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":57
 *     """
 *     if count < 1:
 *         raise ValueError("CPU count must be strictly positive")             # <<<<<<<<<<<<<<
 *     check_status(SetCpuThreadPoolCapacity(count))
 * 
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_CPU_count_must_be_strictly_posit); if (unlikely(!__pyx_tuple_)) __PYX_ERR(6, 57, __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__2 = PyTuple_Pack(1, __pyx_kp_s_self_pool_cannot_be_converted_to); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "(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__3 = PyTuple_Pack(1, __pyx_kp_s_self_pool_cannot_be_converted_to); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "(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__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "(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__5 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "(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__6 = PyTuple_Pack(1, __pyx_kp_s_self_pool_self_proxy_pool_cannot); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "(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__7 = PyTuple_Pack(1, __pyx_kp_s_self_pool_self_proxy_pool_cannot); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "pyarrow/types.pxi":115
 *         ty = dynamic_cast[_CFixedWidthTypePtr](self.type)
 *         if ty == nullptr:
 *             raise ValueError("Non-fixed width type")             # <<<<<<<<<<<<<<
 *         return ty.bit_width()
 * 
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Non_fixed_width_type); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(3, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "pyarrow/types.pxi":363
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Field's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.field` instead.")
 * 
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Do_not_call_Field_s_constructor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(3, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "pyarrow/types.pxi":473
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Schema's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.schema` instead.")
 * 
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Do_not_call_Schema_s_constructor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(3, 473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "pyarrow/types.pxi":985
 *     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__14 = PyTuple_Pack(2, __pyx_int_2, __pyx_int_3); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(3, 985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "pyarrow/types.pxi":1027
 *         unit_code = TimeUnit_NANO
 *     else:
 *         raise ValueError('Invalid TimeUnit string')             # <<<<<<<<<<<<<<
 * 
 *     cdef TimestampType out = TimestampType.__new__(TimestampType)
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Invalid_TimeUnit_string); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(3, 1027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "pyarrow/types.pxi":1224
 *         list_type.reset(new CListType((<Field> value_type).sp_field))
 *     else:
 *         raise ValueError('List requires DataType or Field')             # <<<<<<<<<<<<<<
 * 
 *     out.init(list_type)
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_List_requires_DataType_or_Field); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(3, 1224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "pyarrow/scalar.pxi":29
 *         global NA
 *         if NA is not None:
 *             raise Exception('Cannot create multiple NAType instances')             # <<<<<<<<<<<<<<
 * 
 *         self.type = null()
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_multiple_NAType_in); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "(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__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "(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__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "pyarrow/scalar.pxi":77
 *             return self.as_py() == other
 *         else:
 *             raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                 "Cannot compare Arrow values that don't support as_py()")
 * 
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Cannot_compare_Arrow_values_that); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "(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__21 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "(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__22 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "(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__23 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "(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__24 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "(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__25 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "(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__26 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "(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__27 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "(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__28 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "(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__29 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "(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__30 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "(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__31 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "(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__32 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "(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__33 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "(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__34 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "(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__35 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "(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__36 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "(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__37 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "(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__38 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "(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__39 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "(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__40 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "(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__41 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "(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__42 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "(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__43 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "(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__44 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "pyarrow/scalar.pxi":174
 *         if dtype.unit() == TimeUnit_SECOND:
 *             delta = datetime.timedelta(seconds=ap.Value(self.index))
 *             return (datetime.datetime(1970, 1, 1) + delta).time()             # <<<<<<<<<<<<<<
 *         else:
 *             delta = datetime.timedelta(milliseconds=ap.Value(self.index))
 */
  __pyx_tuple__45 = PyTuple_Pack(3, __pyx_int_1970, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "pyarrow/scalar.pxi":177
 *         else:
 *             delta = datetime.timedelta(milliseconds=ap.Value(self.index))
 *             return (datetime.datetime(1970, 1, 1) + delta).time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__45 = PyTuple_Pack(3, __pyx_int_1970, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "(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__46 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "(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__47 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "pyarrow/scalar.pxi":189
 *         cdef int64_t val = ap.Value(self.index)
 *         if dtype.unit() == TimeUnit_MICRO:
 *             return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                     datetime.timedelta(microseconds=val)).time()
 *         else:
 */
  __pyx_tuple__45 = PyTuple_Pack(3, __pyx_int_1970, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "pyarrow/scalar.pxi":192
 *                     datetime.timedelta(microseconds=val)).time()
 *         else:
 *             return (datetime.datetime(1970, 1, 1) +             # <<<<<<<<<<<<<<
 *                     datetime.timedelta(microseconds=val / 1000)).time()
 * 
 */
  __pyx_tuple__45 = PyTuple_Pack(3, __pyx_int_1970, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "(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__48 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "(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__49 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "pyarrow/scalar.pxi":251
 *             converter = DATETIME_CONVERSION_FUNCTIONS[dtype.unit()]
 *         except KeyError:
 *             raise ValueError(             # <<<<<<<<<<<<<<
 *                 'Cannot convert nanosecond timestamps without pandas'
 *             )
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_Cannot_convert_nanosecond_timest); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 251, __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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 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(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "(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__65 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "(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__66 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "(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__67 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "(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__68 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "(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__69 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);

  /* "(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__70 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);

  /* "(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__71 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);

  /* "(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__72 = PyTuple_Pack(1, __pyx_kp_s_self_ap_self_sp_array_cannot_be); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);

  /* "(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__73 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "(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__74 = PyTuple_Pack(1, __pyx_kp_s_self_sp_array_cannot_be_converte); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);

  /* "pyarrow/array.pxi":222
 *     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__76 = PyTuple_Pack(1, __pyx_kp_s_only_slices_with_step_1_supporte); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(2, 222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "pyarrow/array.pxi":232
 *         index += length
 *         if index < 0:
 *             raise IndexError("index out of bounds")             # <<<<<<<<<<<<<<
 *     elif index >= length:
 *         raise IndexError("index out of bounds")
 */
  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(2, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "pyarrow/array.pxi":234
 *             raise IndexError("index out of bounds")
 *     elif index >= length:
 *         raise IndexError("index out of bounds")             # <<<<<<<<<<<<<<
 *     return index
 * 
 */
  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_index_out_of_bounds); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(2, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "(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__78 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "(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__79 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "pyarrow/array.pxi":257
 *         return pyarrow_wrap_chunked_array(datum.chunked_array())
 *     else:
 *         raise ValueError("Unable to wrap Datum in a Python object")             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_wrap_Datum_in_a_Python); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(2, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);

  /* "pyarrow/array.pxi":353
 * 
 *     def __eq__(self, other):
 *         raise NotImplementedError('Comparisons with pyarrow.Array are not '             # <<<<<<<<<<<<<<
 *                                   'implemented')
 * 
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_Comparisons_with_pyarrow_Array_a); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(2, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);

  /* "pyarrow/array.pxi":510
 * 
 *         if not is_primitive(type.id):
 *             raise NotImplementedError("from_buffers is only supported for "             # <<<<<<<<<<<<<<
 *                                       "primitive arrays yet.")
 * 
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_from_buffers_is_only_supported_f); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(2, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);

  /* "pyarrow/array.pxi":594
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_Offset_must_be_non_negative); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(2, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "pyarrow/array.pxi":658
 *         """
 *         if self.null_count:
 *             raise NotImplementedError('NumPy array view is only supported '             # <<<<<<<<<<<<<<
 *                                       'for arrays without nulls.')
 *         if not is_primitive(self.type.id) or self.type.id == _Type_BOOL:
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_NumPy_array_view_is_only_support); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(2, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);

  /* "pyarrow/array.pxi":661
 *                                       'for arrays without nulls.')
 *         if not is_primitive(self.type.id) or self.type.id == _Type_BOOL:
 *             raise NotImplementedError('NumPy array view is only supported '             # <<<<<<<<<<<<<<
 *                                       'for primitive types.')
 *         buflist = self.buffers()
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_NumPy_array_view_is_only_support_2); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(2, 661, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);

  /* "pyarrow/array.pxi":716
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Tensor's constructor directly, use one "             # <<<<<<<<<<<<<<
 *                         "of the `pyarrow.Tensor.from_*` functions instead.")
 * 
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_Do_not_call_Tensor_s_constructor); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(2, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

  /* "(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__87 = PyTuple_Pack(1, __pyx_kp_s_self_sp_tensor_self_tp_cannot_be); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "(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__88 = PyTuple_Pack(1, __pyx_kp_s_self_sp_tensor_self_tp_cannot_be); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);

  /* "pyarrow/array.pxi":1094
 *         if isinstance(indices, Array):
 *             if mask is not None:
 *                 raise NotImplementedError(             # <<<<<<<<<<<<<<
 *                     "mask not implemented with Arrow array inputs yet")
 *             _indices = indices
 */
  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_mask_not_implemented_with_Arrow); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(2, 1094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

  /* "pyarrow/array.pxi":1111
 * 
 *         if not isinstance(_indices, IntegerArray):
 *             raise ValueError('Indices must be integer type')             # <<<<<<<<<<<<<<
 * 
 *         cdef c_bool c_ordered = ordered
 */
  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_Indices_must_be_integer_type); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(2, 1111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "pyarrow/array.pxi":1199
 * 
 *         if names is None:
 *             raise ValueError('Names are currently required')             # <<<<<<<<<<<<<<
 * 
 *         arrays = [asarray(x) for x in arrays]
 */
  __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_Names_are_currently_required); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(2, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);

  /* "pyarrow/array.pxi":1205
 *         num_arrays = len(arrays)
 *         if num_arrays == 0:
 *             raise ValueError("arrays list is empty")             # <<<<<<<<<<<<<<
 * 
 *         length = len(arrays[0])
 */
  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_arrays_list_is_empty); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(2, 1205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

  /* "pyarrow/array.pxi":1213
 *             array = arrays[i]
 *             if len(array) != length:
 *                 raise ValueError("All arrays must have the same length")             # <<<<<<<<<<<<<<
 *             c_arrays[i] = array.sp_array
 * 
 */
  __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_All_arrays_must_have_the_same_le); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(2, 1213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);

  /* "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__94 = PyTuple_Pack(1, __pyx_kp_s_StringBuilder_only_accepts_strin); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(9, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);

  /* "(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__95 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);

  /* "(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__96 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);

  /* "pyarrow/table.pxi":44
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call ChunkedArray's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`chunked_array` function instead.")
 * 
 */
  __pyx_tuple__97 = PyTuple_Pack(1, __pyx_kp_s_Do_not_call_ChunkedArray_s_const); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(10, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "pyarrow/table.pxi":108
 *             return self.getitem(key)
 *         else:
 *             raise TypeError("key must either be a slice or integer")             # <<<<<<<<<<<<<<
 * 
 *     cdef getitem(self, int64_t i):
 */
  __pyx_tuple__98 = PyTuple_Pack(1, __pyx_kp_s_key_must_either_be_a_slice_or_in); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(10, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);

  /* "pyarrow/table.pxi":242
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_Offset_must_be_non_negative); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(10, 242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "pyarrow/table.pxi":275
 *         """
 *         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__99 = PyTuple_Pack(1, __pyx_kp_s_Chunk_index_out_of_range); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(10, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);

  /* "pyarrow/table.pxi":331
 *     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__100 = PyTuple_Pack(1, __pyx_kp_s_Cannot_construct_a_chunked_array); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(10, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);

  /* "pyarrow/table.pxi":364
 *         boxed_field = field_or_name
 *         if arr.type != boxed_field.type:
 *             raise ValueError('Passed field type does not match array')             # <<<<<<<<<<<<<<
 *     else:
 *         boxed_field = field(field_or_name, arr.type)
 */
  __pyx_tuple__101 = PyTuple_Pack(1, __pyx_kp_s_Passed_field_type_does_not_match); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(10, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);

  /* "pyarrow/table.pxi":395
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Column's constructor directly, use one "             # <<<<<<<<<<<<<<
 *                         "of the `Column.from_*` functions instead.")
 * 
 */
  __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_s_Do_not_call_Column_s_constructor); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(10, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);

  /* "pyarrow/table.pxi":420
 *             return not self.equals(other)
 *         else:
 *             raise TypeError('Invalid comparison')             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_s_Invalid_comparison); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(10, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);

  /* "pyarrow/table.pxi":669
 *     else:
 *         if names is None:
 *             raise ValueError('Must pass names when constructing '             # <<<<<<<<<<<<<<
 *                              'from Array objects')
 *         if len(names) != K:
 */
  __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_Must_pass_names_when_constructin); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(10, 669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);

  /* "pyarrow/table.pxi":705
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call RecordBatch's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "one of the `RecordBatch.from_*` functions instead.")
 * 
 */
  __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_s_Do_not_call_RecordBatch_s_constr); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(10, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);

  /* "pyarrow/table.pxi":853
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_Offset_must_be_non_negative); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(10, 853, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "pyarrow/table.pxi":1042
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Table's constructor directly, use one of "             # <<<<<<<<<<<<<<
 *                         "the `Table.from_*` functions instead.")
 * 
 */
  __pyx_tuple__107 = PyTuple_Pack(1, __pyx_kp_s_Do_not_call_Table_s_constructor); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(10, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);

  /* "pyarrow/table.pxi":1256
 *         elif schema is not None:
 *             if names is not None:
 *                 raise ValueError('Cannot pass schema and arrays')             # <<<<<<<<<<<<<<
 *             cy_schema = schema
 * 
 */
  __pyx_tuple__108 = PyTuple_Pack(1, __pyx_kp_s_Cannot_pass_schema_and_arrays); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(10, 1256, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);

  /* "pyarrow/table.pxi":1260
 * 
 *             if len(schema) != len(arrays):
 *                 raise ValueError('Schema and number of arrays unequal')             # <<<<<<<<<<<<<<
 * 
 *             c_schema = cy_schema.sp_schema
 */
  __pyx_tuple__109 = PyTuple_Pack(1, __pyx_kp_s_Schema_and_number_of_arrays_uneq); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(10, 1260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);

  /* "pyarrow/table.pxi":1321
 *         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__110 = PyTuple_Pack(1, __pyx_kp_s_Must_pass_schema_or_at_least_one); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(10, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);

  /* "pyarrow/table.pxi":1466
 *             return self._column(i)
 *         else:
 *             raise TypeError("Index must either be string or integer")             # <<<<<<<<<<<<<<
 * 
 *     def _column(self, int i):
 */
  __pyx_tuple__111 = PyTuple_Pack(1, __pyx_kp_s_Index_must_either_be_string_or_i); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(10, 1466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);

  /* "pyarrow/io.pxi":80
 *             return 'wb'
 *         else:
 *             raise ValueError('File object is malformed, has no mode')             # <<<<<<<<<<<<<<
 * 
 *     def readable(self):
 */
  __pyx_tuple__112 = PyTuple_Pack(1, __pyx_kp_s_File_object_is_malformed_has_no); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(4, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);

  /* "pyarrow/io.pxi":129
 *     def _assert_open(self):
 *         if self.closed:
 *             raise ValueError("I/O operation on closed file")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_readable(self):
 */
  __pyx_tuple__113 = PyTuple_Pack(1, __pyx_kp_s_I_O_operation_on_closed_file); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(4, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "pyarrow/io.pxi":134
 *         self._assert_open()
 *         if not self.is_readable:
 *             raise IOError("only valid on readonly files")             # <<<<<<<<<<<<<<
 * 
 *     def _assert_writable(self):
 */
  __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_s_only_valid_on_readonly_files); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(4, 134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);

  /* "pyarrow/io.pxi":139
 *         self._assert_open()
 *         if not self.is_writable:
 *             raise IOError("only valid on writable files")             # <<<<<<<<<<<<<<
 * 
 *     def size(self):
 */
  __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_s_only_valid_on_writable_files); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(4, 139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);

  /* "pyarrow/io.pxi":383
 *             stream = open(stream_or_path, 'wb')
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 stream.close()
 *         else:
 */
  __pyx_codeobj__116 = (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, 383, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(4, 383, __pyx_L1_error)

  /* "pyarrow/io.pxi":388
 *             stream = stream_or_path
 * 
 *             def cleanup():             # <<<<<<<<<<<<<<
 *                 pass
 * 
 */
  __pyx_codeobj__117 = (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, 388, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(4, 388, __pyx_L1_error)

  /* "pyarrow/io.pxi":394
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */
  __pyx_tuple__118 = PyTuple_Pack(3, __pyx_n_s_buf, __pyx_n_s_e, __pyx_n_s_exc_info); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(4, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);
  __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_bg_write, 394, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(4, 394, __pyx_L1_error)

  /* "pyarrow/io.pxi":465
 *         exc_info = None
 * 
 *         def bg_write():             # <<<<<<<<<<<<<<
 *             try:
 *                 while not done or write_queue.qsize() > 0:
 */
  __pyx_tuple__120 = PyTuple_Pack(3, __pyx_n_s_buf, __pyx_n_s_e, __pyx_n_s_exc_info); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(4, 465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);
  __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_bg_write, 465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(4, 465, __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__122 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);

  /* "(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__123 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);

  /* "(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__124 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);

  /* "(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__125 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);

  /* "(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__126 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);

  /* "(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__127 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);

  /* "(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__128 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);

  /* "(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__129 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);

  /* "(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__130 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);

  /* "(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__131 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__131);
  __Pyx_GIVEREF(__pyx_tuple__131);

  /* "pyarrow/io.pxi":731
 * 
 *     def __init__(self):
 *         raise TypeError("Do not call Buffer's constructor directly, use "             # <<<<<<<<<<<<<<
 *                         "`pyarrow.py_buffer` function instead.")
 * 
 */
  __pyx_tuple__132 = PyTuple_Pack(1, __pyx_kp_s_Do_not_call_Buffer_s_constructor); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(4, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);

  /* "pyarrow/io.pxi":791
 * 
 *         if offset < 0:
 *             raise IndexError('Offset must be non-negative')             # <<<<<<<<<<<<<<
 * 
 *         if length is None:
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_Offset_must_be_non_negative); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(4, 791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "pyarrow/io.pxi":839
 *         else:
 *             if flags & cp.PyBUF_WRITABLE:
 *                 raise BufferError("Writable buffer requested but Arrow "             # <<<<<<<<<<<<<<
 *                                   "buffer was not mutable")
 *             buffer.readonly = 1
 */
  __pyx_tuple__133 = PyTuple_Pack(1, __pyx_kp_s_Writable_buffer_requested_but_Ar); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(4, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);

  /* "pyarrow/io.pxi":860
 *     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__134 = PyTuple_Pack(1, __pyx_kp_s_accessing_non_existent_buffer_se); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(4, 860, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);

  /* "pyarrow/io.pxi":867
 *     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__135 = PyTuple_Pack(1, __pyx_kp_s_trying_to_write_an_immutable_buf); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(4, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);

  /* "pyarrow/io.pxi":869
 *             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_tuple__134 = PyTuple_Pack(1, __pyx_kp_s_accessing_non_existent_buffer_se); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(4, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);

  /* "(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__136 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);

  /* "(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__137 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);

  /* "(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__138 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);

  /* "(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__139 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);

  /* "(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__140 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);

  /* "(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__141 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);

  /* "pyarrow/io.pxi":1050
 *         # TODO: what about read-write sources (e.g. memory maps)
 *         if not nf.is_readable:
 *             raise IOError('Native file is not readable')             # <<<<<<<<<<<<<<
 * 
 *         nf.read_handle(reader)
 */
  __pyx_tuple__142 = PyTuple_Pack(1, __pyx_kp_s_Native_file_is_not_readable); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(4, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);

  /* "pyarrow/io.pxi":1074
 * 
 *         if not nf.is_writable:
 *             raise IOError('Native file is not writable')             # <<<<<<<<<<<<<<
 * 
 *         nf.write_handle(writer)
 */
  __pyx_tuple__143 = PyTuple_Pack(1, __pyx_kp_s_Native_file_is_not_writable); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(4, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);

  /* "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__144 = PyTuple_Pack(1, __pyx_kp_s_HDFS_client_improperly_initializ); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(12, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);

  /* "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__145 = PyTuple_Pack(1, __pyx_kp_s_HDFS_client_is_closed); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(12, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);

  /* "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__146 = PyTuple_Pack(1, __pyx_kp_s_Mode_must_be_rb_read_wb_write_ne); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(12, 402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);

  /* "pyarrow/io-hdfs.pxi":449
 * 
 *     def download(self, path, stream, buffer_size=None):
 *         with self.open(path, 'rb') as f:             # <<<<<<<<<<<<<<
 *             f.download(stream, buffer_size=buffer_size)
 * 
 */
  __pyx_tuple__147 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(12, 449, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);

  /* "pyarrow/io-hdfs.pxi":456
 *         Upload file-like object to HDFS path
 *         """
 *         with self.open(path, 'wb') as f:             # <<<<<<<<<<<<<<
 *             f.upload(stream, buffer_size=buffer_size)
 * 
 */
  __pyx_tuple__147 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(12, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);

  /* "(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__148 = PyTuple_Pack(1, __pyx_kp_s_self_client_cannot_be_converted); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);

  /* "(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__149 = PyTuple_Pack(1, __pyx_kp_s_self_client_cannot_be_converted); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);

  /* "(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__150 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__150);
  __Pyx_GIVEREF(__pyx_tuple__150);

  /* "(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__151 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);

  /* "(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__152 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);

  /* "(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__153 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(8, 4, __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(8, 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(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);

  /* "(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__156 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__156);
  __Pyx_GIVEREF(__pyx_tuple__156);

  /* "(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__157 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);

  /* "(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__158 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__158);
  __Pyx_GIVEREF(__pyx_tuple__158);

  /* "(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__159 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);

  /* "pyarrow/ipc.pxi":269
 *     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__160 = PyTuple_Pack(2, __pyx_kp_s_Please_use_read_next_batch_inste, __pyx_builtin_FutureWarning); if (unlikely(!__pyx_tuple__160)) __PYX_ERR(5, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__160);
  __Pyx_GIVEREF(__pyx_tuple__160);

  /* "(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__161 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__161);
  __Pyx_GIVEREF(__pyx_tuple__161);

  /* "(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__162 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);

  /* "(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__163 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__163);
  __Pyx_GIVEREF(__pyx_tuple__163);

  /* "(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__164 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__164);
  __Pyx_GIVEREF(__pyx_tuple__164);

  /* "(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__165 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);

  /* "(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__166 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__166);
  __Pyx_GIVEREF(__pyx_tuple__166);

  /* "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__167 = PyTuple_Pack(1, __pyx_kp_s_prior_column_had_a_different_num); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(13, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__167);
  __Pyx_GIVEREF(__pyx_tuple__167);

  /* "(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__168 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__168);
  __Pyx_GIVEREF(__pyx_tuple__168);

  /* "(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__169 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__169);
  __Pyx_GIVEREF(__pyx_tuple__169);

  /* "(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__170 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__170);
  __Pyx_GIVEREF(__pyx_tuple__170);

  /* "(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__171 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__171);
  __Pyx_GIVEREF(__pyx_tuple__171);

  /* "(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__172 = PyTuple_Pack(1, __pyx_kp_s_self_data_cannot_be_converted_to); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(8, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__172);
  __Pyx_GIVEREF(__pyx_tuple__172);

  /* "(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__173 = PyTuple_Pack(1, __pyx_kp_s_self_data_cannot_be_converted_to); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(8, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__173);
  __Pyx_GIVEREF(__pyx_tuple__173);

  /* "pyarrow/public-api.pxi":150
 * cdef public 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__174 = PyTuple_Pack(1, __pyx_kp_s_Array_was_NULL); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(16, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__174);
  __Pyx_GIVEREF(__pyx_tuple__174);

  /* "pyarrow/public-api.pxi":155
 * 
 *     if data_type == NULL:
 *         raise ValueError('Array data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     klass = _array_classes[data_type.id()]
 */
  __pyx_tuple__175 = PyTuple_Pack(1, __pyx_kp_s_Array_data_type_was_NULL); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(16, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);

  /* "pyarrow/public-api.pxi":167
 *         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__176 = PyTuple_Pack(1, __pyx_kp_s_ChunkedArray_was_NULL); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(16, 167, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__176);
  __Pyx_GIVEREF(__pyx_tuple__176);

  /* "pyarrow/public-api.pxi":172
 * 
 *     if data_type == NULL:
 *         raise ValueError('ChunkedArray data type was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef ChunkedArray arr = ChunkedArray.__new__(ChunkedArray)
 */
  __pyx_tuple__177 = PyTuple_Pack(1, __pyx_kp_s_ChunkedArray_data_type_was_NULL); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(16, 172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__177);
  __Pyx_GIVEREF(__pyx_tuple__177);

  /* "pyarrow/public-api.pxi":195
 *         const shared_ptr[CTensor]& sp_tensor):
 *     if sp_tensor.get() == NULL:
 *         raise ValueError('Tensor was NULL')             # <<<<<<<<<<<<<<
 * 
 *     cdef Tensor tensor = Tensor.__new__(Tensor)
 */
  __pyx_tuple__178 = PyTuple_Pack(1, __pyx_kp_s_Tensor_was_NULL); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(16, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__178);
  __Pyx_GIVEREF(__pyx_tuple__178);

  /* "FromPyStructUtility":19
 *         value = obj['strings_to_categorical']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'strings_to_categorical'")             # <<<<<<<<<<<<<<
 *     result.strings_to_categorical = value
 *     try:
 */
  __pyx_tuple__179 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(8, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);

  /* "FromPyStructUtility":24
 *         value = obj['zero_copy_only']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'zero_copy_only'")             # <<<<<<<<<<<<<<
 *     result.zero_copy_only = value
 *     try:
 */
  __pyx_tuple__180 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_2); if (unlikely(!__pyx_tuple__180)) __PYX_ERR(8, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__180);
  __Pyx_GIVEREF(__pyx_tuple__180);

  /* "FromPyStructUtility":29
 *         value = obj['integer_object_nulls']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'integer_object_nulls'")             # <<<<<<<<<<<<<<
 *     result.integer_object_nulls = value
 *     try:
 */
  __pyx_tuple__181 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_3); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(8, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__181);
  __Pyx_GIVEREF(__pyx_tuple__181);

  /* "FromPyStructUtility":34
 *         value = obj['date_as_object']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'date_as_object'")             # <<<<<<<<<<<<<<
 *     result.date_as_object = value
 *     try:
 */
  __pyx_tuple__182 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_4); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(8, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__182);
  __Pyx_GIVEREF(__pyx_tuple__182);

  /* "FromPyStructUtility":39
 *         value = obj['use_threads']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'use_threads'")             # <<<<<<<<<<<<<<
 *     result.use_threads = value
 *     return result
 */
  __pyx_tuple__183 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_5); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(8, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__183);
  __Pyx_GIVEREF(__pyx_tuple__183);

  /* "pyarrow/lib.pyx":40
 * 
 * 
 * def cpu_count():             # <<<<<<<<<<<<<<
 *     """
 *     Return the number of threads to use in parallel operations.
 */
  __pyx_codeobj__184 = (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, 40, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(6, 40, __pyx_L1_error)

  /* "pyarrow/lib.pyx":52
 * 
 * 
 * def set_cpu_count(int count):             # <<<<<<<<<<<<<<
 *     """
 *     Set the number of threads to use in parallel operations.
 */
  __pyx_tuple__185 = PyTuple_Pack(2, __pyx_n_s_count, __pyx_n_s_count); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(6, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__185);
  __Pyx_GIVEREF(__pyx_tuple__185);
  __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_lib_pyx, __pyx_n_s_set_cpu_count, 52, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) __PYX_ERR(6, 52, __pyx_L1_error)

  /* "pyarrow/memory.pxi":70
 * 
 * 
 * def default_memory_pool():             # <<<<<<<<<<<<<<
 *     cdef:
 *         MemoryPool pool = MemoryPool.__new__(MemoryPool)
 */
  __pyx_tuple__187 = PyTuple_Pack(1, __pyx_n_s_pool); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(7, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__187);
  __Pyx_GIVEREF(__pyx_tuple__187);
  __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_default_memory_pool, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(7, 70, __pyx_L1_error)

  /* "pyarrow/memory.pxi":77
 * 
 * 
 * def proxy_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Derived MemoryPool class that tracks the number of bytes and
 */
  __pyx_tuple__189 = PyTuple_Pack(2, __pyx_n_s_parent, __pyx_n_s_out); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);
  __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_proxy_memory_pool, 77, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(7, 77, __pyx_L1_error)

  /* "pyarrow/memory.pxi":88
 * 
 * 
 * def set_memory_pool(MemoryPool pool):             # <<<<<<<<<<<<<<
 *     c_set_default_memory_pool(pool.pool)
 * 
 */
  __pyx_tuple__191 = PyTuple_Pack(1, __pyx_n_s_pool); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(7, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);
  __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_set_memory_pool, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) __PYX_ERR(7, 88, __pyx_L1_error)

  /* "pyarrow/memory.pxi":97
 * 
 * 
 * def log_memory_allocations(enable=True):             # <<<<<<<<<<<<<<
 *     """
 *     Enable or disable memory allocator logging for debugging purposes
 */
  __pyx_tuple__193 = PyTuple_Pack(1, __pyx_n_s_enable); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(7, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);
  __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_log_memory_allocations, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(7, 97, __pyx_L1_error)

  /* "pyarrow/memory.pxi":112
 * 
 * 
 * def total_allocated_bytes():             # <<<<<<<<<<<<<<
 *     cdef CMemoryPool* pool = c_get_memory_pool()
 *     return pool.bytes_allocated()
 */
  __pyx_tuple__195 = PyTuple_Pack(1, __pyx_n_s_pool); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(7, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);
  __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__195, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_memory_pxi, __pyx_n_s_total_allocated_bytes, 112, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(7, 112, __pyx_L1_error)

  /* "pyarrow/types.pxi":37
 *     _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__197 = PyTuple_Pack(1, __pyx_kp_s_datetime64_ns); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(3, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);

  /* "pyarrow/types.pxi":38
 *     _Type_DOUBLE: np.float64,
 *     _Type_DATE32: np.dtype('datetime64[ns]'),
 *     _Type_DATE64: np.dtype('datetime64[ns]'),             # <<<<<<<<<<<<<<
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),
 *     _Type_BINARY: np.object_,
 */
  __pyx_tuple__197 = PyTuple_Pack(1, __pyx_kp_s_datetime64_ns); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(3, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);

  /* "pyarrow/types.pxi":39
 *     _Type_DATE32: np.dtype('datetime64[ns]'),
 *     _Type_DATE64: np.dtype('datetime64[ns]'),
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),             # <<<<<<<<<<<<<<
 *     _Type_BINARY: np.object_,
 *     _Type_FIXED_SIZE_BINARY: np.object_,
 */
  __pyx_tuple__197 = PyTuple_Pack(1, __pyx_kp_s_datetime64_ns); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(3, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);

  /* "pyarrow/types.pxi":79
 * 
 * 
 * def _is_primitive(Type type):             # <<<<<<<<<<<<<<
 *     # This is simply a redirect, the official API is in pyarrow.types.
 *     return is_primitive(type)
 */
  __pyx_tuple__198 = PyTuple_Pack(2, __pyx_n_s_type, __pyx_n_s_type); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(3, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__198);
  __Pyx_GIVEREF(__pyx_tuple__198);
  __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__198, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_is_primitive, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(3, 79, __pyx_L1_error)

  /* "pyarrow/types.pxi":794
 * 
 * 
 * def field(name, type, bint nullable=True, dict metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Field instance
 */
  __pyx_tuple__200 = PyTuple_Pack(7, __pyx_n_s_name_2, __pyx_n_s_type, __pyx_n_s_nullable, __pyx_n_s_metadata, __pyx_n_s_c_meta, __pyx_n_s_result, __pyx_n_s_type_3); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(3, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__200);
  __Pyx_GIVEREF(__pyx_tuple__200);
  __pyx_codeobj__201 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__200, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_field, 794, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__201)) __PYX_ERR(3, 794, __pyx_L1_error)

  /* "pyarrow/types.pxi":849
 * 
 * 
 * def null():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of null type
 */
  __pyx_codeobj__202 = (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, 849, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) __PYX_ERR(3, 849, __pyx_L1_error)

  /* "pyarrow/types.pxi":856
 * 
 * 
 * def bool_():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of boolean type
 */
  __pyx_codeobj__203 = (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, 856, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) __PYX_ERR(3, 856, __pyx_L1_error)

  /* "pyarrow/types.pxi":863
 * 
 * 
 * def uint8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned int8 type
 */
  __pyx_codeobj__204 = (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, 863, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) __PYX_ERR(3, 863, __pyx_L1_error)

  /* "pyarrow/types.pxi":870
 * 
 * 
 * def int8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int8 type
 */
  __pyx_codeobj__205 = (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, 870, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(3, 870, __pyx_L1_error)

  /* "pyarrow/types.pxi":877
 * 
 * 
 * def uint16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint16 type
 */
  __pyx_codeobj__206 = (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, 877, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) __PYX_ERR(3, 877, __pyx_L1_error)

  /* "pyarrow/types.pxi":884
 * 
 * 
 * def int16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int16 type
 */
  __pyx_codeobj__207 = (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, 884, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(3, 884, __pyx_L1_error)

  /* "pyarrow/types.pxi":891
 * 
 * 
 * def uint32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint32 type
 */
  __pyx_codeobj__208 = (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, 891, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) __PYX_ERR(3, 891, __pyx_L1_error)

  /* "pyarrow/types.pxi":898
 * 
 * 
 * def int32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int32 type
 */
  __pyx_codeobj__209 = (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, 898, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) __PYX_ERR(3, 898, __pyx_L1_error)

  /* "pyarrow/types.pxi":905
 * 
 * 
 * def uint64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint64 type
 */
  __pyx_codeobj__210 = (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, 905, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) __PYX_ERR(3, 905, __pyx_L1_error)

  /* "pyarrow/types.pxi":912
 * 
 * 
 * def int64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int64 type
 */
  __pyx_codeobj__211 = (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, 912, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) __PYX_ERR(3, 912, __pyx_L1_error)

  /* "pyarrow/types.pxi":934
 * 
 * 
 * _FIXED_OFFSET_RE = re.compile(r'([+-])(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])$')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__212 = PyTuple_Pack(1, __pyx_kp_s_0_0_9_1_0_9_2_0_3_0_5_0_9); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(3, 934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__212);
  __Pyx_GIVEREF(__pyx_tuple__212);

  /* "pyarrow/types.pxi":937
 * 
 * 
 * def tzinfo_to_string(tz):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a time zone object into a string indicating the name of a time
 */
  __pyx_tuple__213 = PyTuple_Pack(4, __pyx_n_s_tz, __pyx_n_s_sign, __pyx_n_s_hours, __pyx_n_s_minutes_2); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(3, 937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__213);
  __Pyx_GIVEREF(__pyx_tuple__213);
  __pyx_codeobj__214 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__213, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_tzinfo_to_string, 937, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__214)) __PYX_ERR(3, 937, __pyx_L1_error)

  /* "pyarrow/types.pxi":963
 * 
 * 
 * def string_to_tzinfo(name):             # <<<<<<<<<<<<<<
 *     """
 *     Converts a string indicating the name of a time zone into a time zone
 */
  __pyx_tuple__215 = PyTuple_Pack(6, __pyx_n_s_name_2, __pyx_n_s_pytz, __pyx_n_s_m, __pyx_n_s_sign, __pyx_n_s_hours, __pyx_n_s_minutes_2); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(3, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__215);
  __Pyx_GIVEREF(__pyx_tuple__215);
  __pyx_codeobj__216 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__215, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_string_to_tzinfo, 963, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__216)) __PYX_ERR(3, 963, __pyx_L1_error)

  /* "pyarrow/types.pxi":991
 * 
 * 
 * def timestamp(unit, tz=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of timestamp type with resolution and optional time zone
 */
  __pyx_tuple__217 = 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__217)) __PYX_ERR(3, 991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__217);
  __Pyx_GIVEREF(__pyx_tuple__217);
  __pyx_codeobj__218 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__217, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_timestamp, 991, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__218)) __PYX_ERR(3, 991, __pyx_L1_error)

  /* "pyarrow/types.pxi":1046
 * 
 * 
 * def time32(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit time (time of day) type with unit resolution
 */
  __pyx_tuple__219 = 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__219)) __PYX_ERR(3, 1046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__219);
  __Pyx_GIVEREF(__pyx_tuple__219);
  __pyx_codeobj__220 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__219, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_time32, 1046, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) __PYX_ERR(3, 1046, __pyx_L1_error)

  /* "pyarrow/types.pxi":1084
 * 
 * 
 * def time64(unit):             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit time (time of day) type with unit resolution
 */
  __pyx_tuple__221 = 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__221)) __PYX_ERR(3, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__221);
  __Pyx_GIVEREF(__pyx_tuple__221);
  __pyx_codeobj__222 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__221, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_time64, 1084, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__222)) __PYX_ERR(3, 1084, __pyx_L1_error)

  /* "pyarrow/types.pxi":1122
 * 
 * 
 * def date32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit date (days since UNIX epoch 1970-01-01)
 */
  __pyx_codeobj__223 = (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, 1122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(3, 1122, __pyx_L1_error)

  /* "pyarrow/types.pxi":1129
 * 
 * 
 * def date64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)
 */
  __pyx_codeobj__224 = (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, 1129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__224)) __PYX_ERR(3, 1129, __pyx_L1_error)

  /* "pyarrow/types.pxi":1136
 * 
 * 
 * def float16():             # <<<<<<<<<<<<<<
 *     """
 *     Create half-precision floating point type
 */
  __pyx_codeobj__225 = (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, 1136, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(3, 1136, __pyx_L1_error)

  /* "pyarrow/types.pxi":1143
 * 
 * 
 * def float32():             # <<<<<<<<<<<<<<
 *     """
 *     Create single-precision floating point type
 */
  __pyx_codeobj__226 = (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, 1143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__226)) __PYX_ERR(3, 1143, __pyx_L1_error)

  /* "pyarrow/types.pxi":1150
 * 
 * 
 * def float64():             # <<<<<<<<<<<<<<
 *     """
 *     Create double-precision floating point type
 */
  __pyx_codeobj__227 = (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, 1150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) __PYX_ERR(3, 1150, __pyx_L1_error)

  /* "pyarrow/types.pxi":1175
 * 
 * 
 * def string():             # <<<<<<<<<<<<<<
 *     """
 *     Create UTF8 variable-length string type
 */
  __pyx_codeobj__228 = (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, 1175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__228)) __PYX_ERR(3, 1175, __pyx_L1_error)

  /* "pyarrow/types.pxi":1182
 * 
 * 
 * def binary(int length=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create variable-length binary type
 */
  __pyx_tuple__229 = PyTuple_Pack(2, __pyx_n_s_length, __pyx_n_s_fixed_size_binary_type); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(3, 1182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__229);
  __Pyx_GIVEREF(__pyx_tuple__229);
  __pyx_codeobj__230 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_binary, 1182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__230)) __PYX_ERR(3, 1182, __pyx_L1_error)

  /* "pyarrow/types.pxi":1254
 * 
 * 
 * def struct(fields):             # <<<<<<<<<<<<<<
 *     """
 *     Create StructType instance from fields
 */
  __pyx_tuple__231 = 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__231)) __PYX_ERR(3, 1254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__231);
  __Pyx_GIVEREF(__pyx_tuple__231);
  __pyx_codeobj__232 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__231, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_struct, 1254, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__232)) __PYX_ERR(3, 1254, __pyx_L1_error)

  /* "pyarrow/types.pxi":1302
 * 
 * 
 * def union(children_fields, mode):             # <<<<<<<<<<<<<<
 *     """
 *     Create UnionType from children fields.
 */
  __pyx_tuple__233 = PyTuple_Pack(7, __pyx_n_s_children_fields, __pyx_n_s_mode, __pyx_n_s_child_field, __pyx_n_s_c_fields, __pyx_n_s_type_codes, __pyx_n_s_union_type, __pyx_n_s_i); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(3, 1302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__233);
  __Pyx_GIVEREF(__pyx_tuple__233);
  __pyx_codeobj__234 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__233, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_union, 1302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__234)) __PYX_ERR(3, 1302, __pyx_L1_error)

  /* "pyarrow/types.pxi":1384
 *     'date32[day]': date32,
 *     'date64[ms]': date64,
 *     'time32[s]': time32('s'),             # <<<<<<<<<<<<<<
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),
 */
  __pyx_tuple__235 = PyTuple_Pack(1, __pyx_n_s_s); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(3, 1384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__235);
  __Pyx_GIVEREF(__pyx_tuple__235);

  /* "pyarrow/types.pxi":1385
 *     'date64[ms]': date64,
 *     'time32[s]': time32('s'),
 *     'time32[ms]': time32('ms'),             # <<<<<<<<<<<<<<
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),
 */
  __pyx_tuple__236 = PyTuple_Pack(1, __pyx_n_s_ms); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(3, 1385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__236);
  __Pyx_GIVEREF(__pyx_tuple__236);

  /* "pyarrow/types.pxi":1386
 *     'time32[s]': time32('s'),
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),             # <<<<<<<<<<<<<<
 *     'time64[ns]': time64('ns'),
 *     'timestamp[s]': timestamp('s'),
 */
  __pyx_tuple__237 = PyTuple_Pack(1, __pyx_n_s_us); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(3, 1386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__237);
  __Pyx_GIVEREF(__pyx_tuple__237);

  /* "pyarrow/types.pxi":1387
 *     'time32[ms]': time32('ms'),
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),             # <<<<<<<<<<<<<<
 *     'timestamp[s]': timestamp('s'),
 *     'timestamp[ms]': timestamp('ms'),
 */
  __pyx_tuple__238 = PyTuple_Pack(1, __pyx_n_s_ns); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(3, 1387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__238);
  __Pyx_GIVEREF(__pyx_tuple__238);

  /* "pyarrow/types.pxi":1388
 *     'time64[us]': time64('us'),
 *     'time64[ns]': time64('ns'),
 *     'timestamp[s]': timestamp('s'),             # <<<<<<<<<<<<<<
 *     'timestamp[ms]': timestamp('ms'),
 *     'timestamp[us]': timestamp('us'),
 */
  __pyx_tuple__235 = PyTuple_Pack(1, __pyx_n_s_s); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(3, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__235);
  __Pyx_GIVEREF(__pyx_tuple__235);

  /* "pyarrow/types.pxi":1389
 *     'time64[ns]': time64('ns'),
 *     'timestamp[s]': timestamp('s'),
 *     'timestamp[ms]': timestamp('ms'),             # <<<<<<<<<<<<<<
 *     'timestamp[us]': timestamp('us'),
 *     'timestamp[ns]': timestamp('ns'),
 */
  __pyx_tuple__236 = PyTuple_Pack(1, __pyx_n_s_ms); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(3, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__236);
  __Pyx_GIVEREF(__pyx_tuple__236);

  /* "pyarrow/types.pxi":1390
 *     'timestamp[s]': timestamp('s'),
 *     'timestamp[ms]': timestamp('ms'),
 *     'timestamp[us]': timestamp('us'),             # <<<<<<<<<<<<<<
 *     'timestamp[ns]': timestamp('ns'),
 * }
 */
  __pyx_tuple__237 = PyTuple_Pack(1, __pyx_n_s_us); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(3, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__237);
  __Pyx_GIVEREF(__pyx_tuple__237);

  /* "pyarrow/types.pxi":1391
 *     'timestamp[ms]': timestamp('ms'),
 *     'timestamp[us]': timestamp('us'),
 *     'timestamp[ns]': timestamp('ns'),             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_tuple__238 = PyTuple_Pack(1, __pyx_n_s_ns); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(3, 1391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__238);
  __Pyx_GIVEREF(__pyx_tuple__238);

  /* "pyarrow/types.pxi":1395
 * 
 * 
 * def type_for_alias(name):             # <<<<<<<<<<<<<<
 *     """
 *     Return DataType given a string alias if one exists
 */
  __pyx_tuple__239 = PyTuple_Pack(2, __pyx_n_s_name_2, __pyx_n_s_alias); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(3, 1395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__239);
  __Pyx_GIVEREF(__pyx_tuple__239);
  __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_type_for_alias, 1395, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) __PYX_ERR(3, 1395, __pyx_L1_error)

  /* "pyarrow/types.pxi":1414
 * 
 * 
 * def schema(fields, dict metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct pyarrow.Schema from collection of fields
 */
  __pyx_tuple__241 = 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__241)) __PYX_ERR(3, 1414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__241);
  __Pyx_GIVEREF(__pyx_tuple__241);
  __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__241, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_schema, 1414, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) __PYX_ERR(3, 1414, __pyx_L1_error)

  /* "pyarrow/types.pxi":1465
 * 
 * 
 * def from_numpy_dtype(object dtype):             # <<<<<<<<<<<<<<
 *     """
 *     Convert NumPy dtype to pyarrow.DataType
 */
  __pyx_tuple__243 = PyTuple_Pack(2, __pyx_n_s_dtype, __pyx_n_s_c_type); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(3, 1465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__243);
  __Pyx_GIVEREF(__pyx_tuple__243);
  __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_from_numpy_dtype, 1465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) __PYX_ERR(3, 1465, __pyx_L1_error)

  /* "pyarrow/types.pxi":1477
 * 
 * 
 * def is_boolean_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyBool(obj)
 * 
 */
  __pyx_tuple__245 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(3, 1477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__245);
  __Pyx_GIVEREF(__pyx_tuple__245);
  __pyx_codeobj__246 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__245, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_is_boolean_value, 1477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__246)) __PYX_ERR(3, 1477, __pyx_L1_error)

  /* "pyarrow/types.pxi":1481
 * 
 * 
 * def is_integer_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyInt(obj)
 * 
 */
  __pyx_tuple__247 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(3, 1481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__247);
  __Pyx_GIVEREF(__pyx_tuple__247);
  __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_is_integer_value, 1481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) __PYX_ERR(3, 1481, __pyx_L1_error)

  /* "pyarrow/types.pxi":1485
 * 
 * 
 * def is_float_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyFloat(obj)
 */
  __pyx_tuple__249 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__249)) __PYX_ERR(3, 1485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__249);
  __Pyx_GIVEREF(__pyx_tuple__249);
  __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__249, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_types_pxi, __pyx_n_s_is_float_value, 1485, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) __PYX_ERR(3, 1485, __pyx_L1_error)

  /* "pyarrow/array.pxi":87
 * 
 * 
 * def array(object obj, type=None, mask=None, size=None, bint from_pandas=False,             # <<<<<<<<<<<<<<
 *           bint safe=True, MemoryPool memory_pool=None):
 *     """
 */
  __pyx_tuple__251 = PyTuple_Pack(10, __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_values, __pyx_n_s_pdcompat); if (unlikely(!__pyx_tuple__251)) __PYX_ERR(2, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__251);
  __Pyx_GIVEREF(__pyx_tuple__251);
  __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(7, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__251, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_array, 87, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) __PYX_ERR(2, 87, __pyx_L1_error)

  /* "pyarrow/array.pxi":176
 * 
 * 
 * def asarray(values, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Convert to pyarrow.Array, inferring type if not provided. Attempt to cast
 */
  __pyx_tuple__253 = PyTuple_Pack(2, __pyx_n_s_values, __pyx_n_s_type); if (unlikely(!__pyx_tuple__253)) __PYX_ERR(2, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__253);
  __Pyx_GIVEREF(__pyx_tuple__253);
  __pyx_codeobj__254 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__253, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_asarray, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__254)) __PYX_ERR(2, 176, __pyx_L1_error)

  /* "pyarrow/array.pxi":199
 * 
 * 
 * def _normalize_slice(object arrow_obj, slice key):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t start, stop, step
 */
  __pyx_tuple__255 = 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__255)) __PYX_ERR(2, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__255);
  __Pyx_GIVEREF(__pyx_tuple__255);
  __pyx_codeobj__256 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__255, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_normalize_slice, 199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__256)) __PYX_ERR(2, 199, __pyx_L1_error)

  /* "pyarrow/array.pxi":332
 * 
 * 
 * def _restore_array(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct an Array from pickled ArrayData.
 */
  __pyx_tuple__257 = PyTuple_Pack(2, __pyx_n_s_data, __pyx_n_s_ad); if (unlikely(!__pyx_tuple__257)) __PYX_ERR(2, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__257);
  __Pyx_GIVEREF(__pyx_tuple__257);
  __pyx_codeobj__258 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__257, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_restore_array, 332, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__258)) __PYX_ERR(2, 332, __pyx_L1_error)

  /* "pyarrow/array.pxi":442
 * 
 *     @staticmethod
 *     def from_pandas(obj, mask=None, type=None, bint safe=True,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool=None):
 *         """
 */
  __pyx_tuple__259 = 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__259)) __PYX_ERR(2, 442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__259);
  __Pyx_GIVEREF(__pyx_tuple__259);
  __pyx_codeobj__260 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__259, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_pandas, 442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) __PYX_ERR(2, 442, __pyx_L1_error)

  /* "pyarrow/array.pxi":482
 * 
 *     @staticmethod
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0):             # <<<<<<<<<<<<<<
 *         """
 *         Construct an Array from a sequence of buffers.  The concrete type
 */
  __pyx_tuple__261 = PyTuple_Pack(8, __pyx_n_s_type, __pyx_n_s_length, __pyx_n_s_buffers, __pyx_n_s_null_count, __pyx_n_s_offset, __pyx_n_s_buf, __pyx_n_s_c_buffers, __pyx_n_s_ad); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(2, 482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__261);
  __Pyx_GIVEREF(__pyx_tuple__261);
  __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__261, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_buffers, 482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) __PYX_ERR(2, 482, __pyx_L1_error)

  /* "pyarrow/array.pxi":731
 * 
 *     @staticmethod
 *     def from_numpy(obj):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CTensor] ctensor
 *         with nogil:
 */
  __pyx_tuple__263 = PyTuple_Pack(2, __pyx_n_s_obj, __pyx_n_s_ctensor); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(2, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__263);
  __Pyx_GIVEREF(__pyx_tuple__263);
  __pyx_codeobj__264 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__263, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_numpy, 731, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__264)) __PYX_ERR(2, 731, __pyx_L1_error)

  /* "pyarrow/array.pxi":914
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ListArray from arrays of int32 offsets and values
 */
  __pyx_tuple__265 = PyTuple_Pack(7, __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); if (unlikely(!__pyx_tuple__265)) __PYX_ERR(2, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__265);
  __Pyx_GIVEREF(__pyx_tuple__265);
  __pyx_codeobj__266 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__265, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_arrays, 914, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) __PYX_ERR(2, 914, __pyx_L1_error)

  /* "pyarrow/array.pxi":944
 * 
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children):             # <<<<<<<<<<<<<<
 *         """
 *         Construct dense UnionArray from arrays of int8 types, int32 offsets and
 */
  __pyx_tuple__267 = PyTuple_Pack(6, __pyx_n_s_types, __pyx_n_s_value_offsets, __pyx_n_s_children, __pyx_n_s_out, __pyx_n_s_c, __pyx_n_s_child); if (unlikely(!__pyx_tuple__267)) __PYX_ERR(2, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__267);
  __Pyx_GIVEREF(__pyx_tuple__267);
  __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__267, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_dense, 944, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) __PYX_ERR(2, 944, __pyx_L1_error)

  /* "pyarrow/array.pxi":970
 * 
 *     @staticmethod
 *     def from_sparse(Array types, list children):             # <<<<<<<<<<<<<<
 *         """
 *         Construct sparse UnionArray from arrays of int8 types and children
 */
  __pyx_tuple__269 = PyTuple_Pack(5, __pyx_n_s_types, __pyx_n_s_children, __pyx_n_s_out, __pyx_n_s_c, __pyx_n_s_child); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(2, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__269);
  __Pyx_GIVEREF(__pyx_tuple__269);
  __pyx_codeobj__270 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_sparse, 970, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) __PYX_ERR(2, 970, __pyx_L1_error)

  /* "pyarrow/array.pxi":997
 * 
 *     @staticmethod
 *     def from_buffers(int length, Buffer value_offsets, Buffer data,             # <<<<<<<<<<<<<<
 *                      Buffer null_bitmap=None, int null_count=-1,
 *                      int offset=0):
 */
  __pyx_tuple__271 = PyTuple_Pack(8, __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, __pyx_n_s_c_null_bitmap, __pyx_n_s_out); if (unlikely(!__pyx_tuple__271)) __PYX_ERR(2, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__271);
  __Pyx_GIVEREF(__pyx_tuple__271);
  __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(6, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__271, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_buffers, 997, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) __PYX_ERR(2, 997, __pyx_L1_error)

  /* "pyarrow/array.pxi":1060
 * 
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,             # <<<<<<<<<<<<<<
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */
  __pyx_tuple__273 = PyTuple_Pack(12, __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); if (unlikely(!__pyx_tuple__273)) __PYX_ERR(2, 1060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__273);
  __Pyx_GIVEREF(__pyx_tuple__273);
  __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(7, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__273, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_arrays, 1060, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) __PYX_ERR(2, 1060, __pyx_L1_error)

  /* "pyarrow/array.pxi":1174
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct StructArray from collection of arrays representing each field
 */
  __pyx_tuple__275 = PyTuple_Pack(12, __pyx_n_s_arrays, __pyx_n_s_names, __pyx_n_s_array, __pyx_n_s_c_array, __pyx_n_s_c_arrays, __pyx_n_s_c_result, __pyx_n_s_num_arrays, __pyx_n_s_length, __pyx_n_s_i, __pyx_n_s_struct_type, __pyx_n_s_x, __pyx_n_s_name_2); if (unlikely(!__pyx_tuple__275)) __PYX_ERR(2, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__275);
  __Pyx_GIVEREF(__pyx_tuple__275);
  __pyx_codeobj__276 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__275, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_array_pxi, __pyx_n_s_from_arrays, 1174, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__276)) __PYX_ERR(2, 1174, __pyx_L1_error)

  /* "pyarrow/table.pxi":297
 * 
 * 
 * def chunked_array(arrays, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct chunked array from list of array-like objects
 */
  __pyx_tuple__277 = 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__277)) __PYX_ERR(10, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__277);
  __Pyx_GIVEREF(__pyx_tuple__277);
  __pyx_codeobj__278 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__277, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_chunked_array, 297, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__278)) __PYX_ERR(10, 297, __pyx_L1_error)

  /* "pyarrow/table.pxi":337
 * 
 * 
 * def column(object field_or_name, arr):             # <<<<<<<<<<<<<<
 *     """
 *     Create Column object from field/string and array-like data
 */
  __pyx_tuple__279 = PyTuple_Pack(6, __pyx_n_s_field_or_name, __pyx_n_s_arr, __pyx_n_s_boxed_field, __pyx_n_s_arr_2, __pyx_n_s_carr, __pyx_n_s_sp_column); if (unlikely(!__pyx_tuple__279)) __PYX_ERR(10, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__279);
  __Pyx_GIVEREF(__pyx_tuple__279);
  __pyx_codeobj__280 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__279, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_column, 337, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__280)) __PYX_ERR(10, 337, __pyx_L1_error)

  /* "pyarrow/table.pxi":426
 * 
 *     @staticmethod
 *     def from_array(*args):             # <<<<<<<<<<<<<<
 *         return column(*args)
 * 
 */
  __pyx_tuple__281 = PyTuple_Pack(1, __pyx_n_s_args); if (unlikely(!__pyx_tuple__281)) __PYX_ERR(10, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__281);
  __Pyx_GIVEREF(__pyx_tuple__281);
  __pyx_codeobj__282 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__281, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_table_pxi, __pyx_n_s_from_array, 426, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__282)) __PYX_ERR(10, 426, __pyx_L1_error)

  /* "pyarrow/table.pxi":956
 * 
 *     @staticmethod
 *     def from_arrays(list arrays, names, dict metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from multiple pyarrow.Arrays
 */
  __pyx_tuple__283 = PyTuple_Pack(10, __pyx_n_s_arrays, __pyx_n_s_names, __pyx_n_s_metadata, __pyx_n_s_arr, __pyx_n_s_c_name, __pyx_n_s_c_schema, __pyx_n_s_c_arrays, __pyx_n_s_num_rows, __pyx_n_s_i, __pyx_n_s_number_of_arrays); if (unlikely(!__pyx_tuple__283)) __PYX_ERR(10, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__283);
  __Pyx_GIVEREF(__pyx_tuple__283);
  __pyx_codeobj__284 = (PyObject*)__Pyx_PyCode_New(3, 0, 10, 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_table_pxi, __pyx_n_s_from_arrays, 956, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__284)) __PYX_ERR(10, 956, __pyx_L1_error)

  /* "pyarrow/table.pxi":1000
 * 
 * 
 * def _reconstruct_record_batch(columns, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct RecordBatch from pickled components.
 */
  __pyx_tuple__285 = PyTuple_Pack(2, __pyx_n_s_columns, __pyx_n_s_schema); if (unlikely(!__pyx_tuple__285)) __PYX_ERR(10, 1000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__285);
  __Pyx_GIVEREF(__pyx_tuple__285);
  __pyx_codeobj__286 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 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_table_pxi, __pyx_n_s_reconstruct_record_batch, 1000, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__286)) __PYX_ERR(10, 1000, __pyx_L1_error)

  /* "pyarrow/table.pxi":1007
 * 
 * 
 * def table_to_blocks(PandasOptions options, Table table,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool, categories):
 *     cdef:
 */
  __pyx_tuple__287 = PyTuple_Pack(9, __pyx_n_s_options, __pyx_n_s_table, __pyx_n_s_memory_pool, __pyx_n_s_categories, __pyx_n_s_result_obj, __pyx_n_s_c_table, __pyx_n_s_pool, __pyx_n_s_categorical_columns, __pyx_n_s_cat); if (unlikely(!__pyx_tuple__287)) __PYX_ERR(10, 1007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__287);
  __Pyx_GIVEREF(__pyx_tuple__287);
  __pyx_codeobj__288 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 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_table_pxi, __pyx_n_s_table_to_blocks, 1007, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__288)) __PYX_ERR(10, 1007, __pyx_L1_error)

  /* "pyarrow/table.pxi":1228
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, schema=None, dict metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays or columns
 */
  __pyx_tuple__289 = PyTuple_Pack(10, __pyx_n_s_arrays, __pyx_n_s_names, __pyx_n_s_schema, __pyx_n_s_metadata, __pyx_n_s_columns, __pyx_n_s_cy_schema, __pyx_n_s_c_schema, __pyx_n_s_table, __pyx_n_s_i, __pyx_n_s_K); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(10, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__289);
  __Pyx_GIVEREF(__pyx_tuple__289);
  __pyx_codeobj__290 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 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_table_pxi, __pyx_n_s_from_arrays, 1228, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__290)) __PYX_ERR(10, 1228, __pyx_L1_error)

  /* "pyarrow/table.pxi":1295
 * 
 *     @staticmethod
 *     def from_batches(batches, Schema schema=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from a sequence or iterator of Arrow RecordBatches
 */
  __pyx_tuple__291 = 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__291)) __PYX_ERR(10, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__291);
  __Pyx_GIVEREF(__pyx_tuple__291);
  __pyx_codeobj__292 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 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_table_pxi, __pyx_n_s_from_batches, 1295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__292)) __PYX_ERR(10, 1295, __pyx_L1_error)

  /* "pyarrow/table.pxi":1619
 * 
 * 
 * def _reconstruct_table(arrays, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct pa.Table from pickled components.
 */
  __pyx_tuple__293 = PyTuple_Pack(2, __pyx_n_s_arrays, __pyx_n_s_schema); if (unlikely(!__pyx_tuple__293)) __PYX_ERR(10, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__293);
  __Pyx_GIVEREF(__pyx_tuple__293);
  __pyx_codeobj__294 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 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_table_pxi, __pyx_n_s_reconstruct_table, 1619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__294)) __PYX_ERR(10, 1619, __pyx_L1_error)

  /* "pyarrow/table.pxi":1626
 * 
 * 
 * def concat_tables(tables):             # <<<<<<<<<<<<<<
 *     """
 *     Perform zero-copy concatenation of pyarrow.Table objects. Raises exception
 */
  __pyx_tuple__295 = PyTuple_Pack(4, __pyx_n_s_tables, __pyx_n_s_c_tables, __pyx_n_s_c_result, __pyx_n_s_table); if (unlikely(!__pyx_tuple__295)) __PYX_ERR(10, 1626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__295);
  __Pyx_GIVEREF(__pyx_tuple__295);
  __pyx_codeobj__296 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 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_table_pxi, __pyx_n_s_concat_tables, 1626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__296)) __PYX_ERR(10, 1626, __pyx_L1_error)

  /* "pyarrow/io.pxi":556
 * 
 *     @staticmethod
 *     def create(path, size):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CMemoryMappedFile] handle
 */
  __pyx_tuple__297 = 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__297)) __PYX_ERR(4, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__297);
  __Pyx_GIVEREF(__pyx_tuple__297);
  __pyx_codeobj__298 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 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_io_pxi, __pyx_n_s_create, 556, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__298)) __PYX_ERR(4, 556, __pyx_L1_error)

  /* "pyarrow/io.pxi":620
 * 
 * 
 * def memory_map(path, mode='r'):             # <<<<<<<<<<<<<<
 *     """
 *     Open memory map at file path. Size of the memory map cannot change
 */
  __pyx_tuple__299 = PyTuple_Pack(3, __pyx_n_s_path, __pyx_n_s_mode, __pyx_n_s_mmap); if (unlikely(!__pyx_tuple__299)) __PYX_ERR(4, 620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__299);
  __Pyx_GIVEREF(__pyx_tuple__299);
  __pyx_codeobj__300 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 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_io_pxi, __pyx_n_s_memory_map, 620, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) __PYX_ERR(4, 620, __pyx_L1_error)

  /* "pyarrow/io.pxi":638
 * 
 * 
 * def create_memory_map(path, size):             # <<<<<<<<<<<<<<
 *     """
 *     Create memory map at indicated path of the given size, return open
 */
  __pyx_tuple__301 = PyTuple_Pack(2, __pyx_n_s_path, __pyx_n_s_size); if (unlikely(!__pyx_tuple__301)) __PYX_ERR(4, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__301);
  __Pyx_GIVEREF(__pyx_tuple__301);
  __pyx_codeobj__302 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__301, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_create_memory_map, 638, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__302)) __PYX_ERR(4, 638, __pyx_L1_error)

  /* "pyarrow/io.pxi":905
 * 
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,             # <<<<<<<<<<<<<<
 *                     resizable=False):
 *     """
 */
  __pyx_tuple__303 = 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__303)) __PYX_ERR(4, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__303);
  __Pyx_GIVEREF(__pyx_tuple__303);
  __pyx_codeobj__304 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 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_io_pxi, __pyx_n_s_allocate_buffer, 905, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__304)) __PYX_ERR(4, 905, __pyx_L1_error)

  /* "pyarrow/io.pxi":997
 * 
 * 
 * def py_buffer(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer from a Python bytes object
 */
  __pyx_tuple__305 = PyTuple_Pack(2, __pyx_n_s_obj, __pyx_n_s_buf); if (unlikely(!__pyx_tuple__305)) __PYX_ERR(4, 997, __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_io_pxi, __pyx_n_s_py_buffer, 997, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__306)) __PYX_ERR(4, 997, __pyx_L1_error)

  /* "pyarrow/io.pxi":1006
 * 
 * 
 * def foreign_buffer(address, size, base):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer with the given *address* and *size*,
 */
  __pyx_tuple__307 = 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__307)) __PYX_ERR(4, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__307);
  __Pyx_GIVEREF(__pyx_tuple__307);
  __pyx_codeobj__308 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 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_io_pxi, __pyx_n_s_foreign_buffer, 1006, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__308)) __PYX_ERR(4, 1006, __pyx_L1_error)

  /* "pyarrow/io.pxi":1021
 * 
 * 
 * def as_buffer(object o):             # <<<<<<<<<<<<<<
 *     if isinstance(o, Buffer):
 *         return o
 */
  __pyx_tuple__309 = PyTuple_Pack(1, __pyx_n_s_o); if (unlikely(!__pyx_tuple__309)) __PYX_ERR(4, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__309);
  __Pyx_GIVEREF(__pyx_tuple__309);
  __pyx_codeobj__310 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 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_io_pxi, __pyx_n_s_as_buffer, 1021, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__310)) __PYX_ERR(4, 1021, __pyx_L1_error)

  /* "pyarrow/io.pxi":1102
 * 
 * 
 * def compress(object buf, codec='lz4', asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Compress pyarrow.Buffer or Python object supporting the buffer (memoryview)
 */
  __pyx_tuple__311 = PyTuple_Pack(12, __pyx_n_s_buf, __pyx_n_s_codec, __pyx_n_s_asbytes, __pyx_n_s_memory_pool, __pyx_n_s_c_codec, __pyx_n_s_compressor, __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__311)) __PYX_ERR(4, 1102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__311);
  __Pyx_GIVEREF(__pyx_tuple__311);
  __pyx_codeobj__312 = (PyObject*)__Pyx_PyCode_New(4, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__311, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_compress, 1102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__312)) __PYX_ERR(4, 1102, __pyx_L1_error)

  /* "pyarrow/io.pxi":1165
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, memory_pool=None):
 *     """
 */
  __pyx_tuple__313 = PyTuple_Pack(12, __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_c_codec, __pyx_n_s_compressor, __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__313)) __PYX_ERR(4, 1165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__313);
  __Pyx_GIVEREF(__pyx_tuple__313);
  __pyx_codeobj__314 = (PyObject*)__Pyx_PyCode_New(5, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__313, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_io_pxi, __pyx_n_s_decompress, 1165, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__314)) __PYX_ERR(4, 1165, __pyx_L1_error)

  /* "pyarrow/io-hdfs.pxi":21
 * # HDFS IO implementation
 * 
 * _HDFS_PATH_RE = re.compile('hdfs://(.*):(\d+)(.*)')             # <<<<<<<<<<<<<<
 * 
 * try:
 */
  __pyx_tuple__315 = PyTuple_Pack(1, __pyx_kp_s_hdfs_d); if (unlikely(!__pyx_tuple__315)) __PYX_ERR(12, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__315);
  __Pyx_GIVEREF(__pyx_tuple__315);

  /* "pyarrow/io-hdfs.pxi":30
 * 
 * 
 * def have_libhdfs():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */
  __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_io_hdfs_pxi, __pyx_n_s_have_libhdfs, 30, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__316)) __PYX_ERR(12, 30, __pyx_L1_error)

  /* "pyarrow/io-hdfs.pxi":39
 * 
 * 
 * def have_libhdfs3():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */
  __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_io_hdfs_pxi, __pyx_n_s_have_libhdfs3, 39, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__317)) __PYX_ERR(12, 39, __pyx_L1_error)

  /* "pyarrow/io-hdfs.pxi":48
 * 
 * 
 * def strip_hdfs_abspath(path):             # <<<<<<<<<<<<<<
 *     m = _HDFS_PATH_RE.match(path)
 *     if m:
 */
  __pyx_tuple__318 = PyTuple_Pack(2, __pyx_n_s_path, __pyx_n_s_m); if (unlikely(!__pyx_tuple__318)) __PYX_ERR(12, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__318);
  __Pyx_GIVEREF(__pyx_tuple__318);
  __pyx_codeobj__319 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__318, __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__319)) __PYX_ERR(12, 48, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":117
 * 
 *     @staticmethod
 *     def open_stream(source):             # <<<<<<<<<<<<<<
 *         cdef MessageReader result = MessageReader.__new__(MessageReader)
 *         cdef shared_ptr[InputStream] in_stream
 */
  __pyx_tuple__320 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_result, __pyx_n_s_in_stream, __pyx_n_s_reader); if (unlikely(!__pyx_tuple__320)) __PYX_ERR(5, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__320);
  __Pyx_GIVEREF(__pyx_tuple__320);
  __pyx_codeobj__321 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__320, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_open_stream, 117, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__321)) __PYX_ERR(5, 117, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":397
 * 
 * 
 * def get_tensor_size(Tensor tensor):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized Tensor including metadata and padding
 */
  __pyx_tuple__322 = PyTuple_Pack(2, __pyx_n_s_tensor, __pyx_n_s_size); if (unlikely(!__pyx_tuple__322)) __PYX_ERR(5, 397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__322);
  __Pyx_GIVEREF(__pyx_tuple__322);
  __pyx_codeobj__323 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 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_ipc_pxi, __pyx_n_s_get_tensor_size, 397, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__323)) __PYX_ERR(5, 397, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":407
 * 
 * 
 * def get_record_batch_size(RecordBatch batch):             # <<<<<<<<<<<<<<
 *     """
 *     Return total size of serialized RecordBatch including metadata and padding
 */
  __pyx_tuple__324 = PyTuple_Pack(2, __pyx_n_s_batch, __pyx_n_s_size); if (unlikely(!__pyx_tuple__324)) __PYX_ERR(5, 407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__324);
  __Pyx_GIVEREF(__pyx_tuple__324);
  __pyx_codeobj__325 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 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_ipc_pxi, __pyx_n_s_get_record_batch_size, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__325)) __PYX_ERR(5, 407, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":417
 * 
 * 
 * def write_tensor(Tensor tensor, NativeFile dest):             # <<<<<<<<<<<<<<
 *     """
 *     Write pyarrow.Tensor to pyarrow.NativeFile object its current position
 */
  __pyx_tuple__326 = PyTuple_Pack(4, __pyx_n_s_tensor, __pyx_n_s_dest, __pyx_n_s_metadata_length, __pyx_n_s_body_length); if (unlikely(!__pyx_tuple__326)) __PYX_ERR(5, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__326);
  __Pyx_GIVEREF(__pyx_tuple__326);
  __pyx_codeobj__327 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 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_ipc_pxi, __pyx_n_s_write_tensor, 417, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__327)) __PYX_ERR(5, 417, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":445
 * 
 * 
 * def read_tensor(NativeFile 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__328 = PyTuple_Pack(2, __pyx_n_s_source, __pyx_n_s_sp_tensor); if (unlikely(!__pyx_tuple__328)) __PYX_ERR(5, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__328);
  __Pyx_GIVEREF(__pyx_tuple__328);
  __pyx_codeobj__329 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 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_ipc_pxi, __pyx_n_s_read_tensor, 445, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__329)) __PYX_ERR(5, 445, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":469
 * 
 * 
 * def read_message(source):             # <<<<<<<<<<<<<<
 *     """
 *     Read length-prefixed message from file or buffer-like object
 */
  __pyx_tuple__330 = PyTuple_Pack(3, __pyx_n_s_source, __pyx_n_s_result, __pyx_n_s_cpp_file); if (unlikely(!__pyx_tuple__330)) __PYX_ERR(5, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__330);
  __Pyx_GIVEREF(__pyx_tuple__330);
  __pyx_codeobj__331 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 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_ipc_pxi, __pyx_n_s_read_message, 469, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__331)) __PYX_ERR(5, 469, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":506
 * 
 * 
 * def read_schema(obj):             # <<<<<<<<<<<<<<
 *     """
 *     Read Schema from message or buffer
 */
  __pyx_tuple__332 = PyTuple_Pack(3, __pyx_n_s_obj, __pyx_n_s_result, __pyx_n_s_cpp_file); if (unlikely(!__pyx_tuple__332)) __PYX_ERR(5, 506, __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_ipc_pxi, __pyx_n_s_read_schema, 506, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__333)) __PYX_ERR(5, 506, __pyx_L1_error)

  /* "pyarrow/ipc.pxi":533
 * 
 * 
 * def read_record_batch(obj, Schema schema):             # <<<<<<<<<<<<<<
 *     """
 *     Read RecordBatch from message, given a known schema
 */
  __pyx_tuple__334 = PyTuple_Pack(4, __pyx_n_s_obj, __pyx_n_s_schema, __pyx_n_s_result, __pyx_n_s_message); if (unlikely(!__pyx_tuple__334)) __PYX_ERR(5, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__334);
  __Pyx_GIVEREF(__pyx_tuple__334);
  __pyx_codeobj__335 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__334, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_ipc_pxi, __pyx_n_s_read_record_batch, 533, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__335)) __PYX_ERR(5, 533, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":23
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */
  __pyx_tuple__336 = 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__336)) __PYX_ERR(14, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__336);
  __Pyx_GIVEREF(__pyx_tuple__336);
  __pyx_codeobj__337 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__336, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_is_named_tuple, 23, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__337)) __PYX_ERR(14, 23, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":35
 * 
 * class SerializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, example_object):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.example_object = example_object
 */
  __pyx_tuple__338 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_message, __pyx_n_s_example_object); if (unlikely(!__pyx_tuple__338)) __PYX_ERR(14, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__338);
  __Pyx_GIVEREF(__pyx_tuple__338);
  __pyx_codeobj__339 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__338, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_init, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__339)) __PYX_ERR(14, 35, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":41
 * 
 * class DeserializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, type_id):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.type_id = type_id
 */
  __pyx_tuple__340 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_message, __pyx_n_s_type_id); if (unlikely(!__pyx_tuple__340)) __PYX_ERR(14, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__340);
  __Pyx_GIVEREF(__pyx_tuple__340);
  __pyx_codeobj__341 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__340, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_init, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__341)) __PYX_ERR(14, 41, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":275
 * 
 *     @staticmethod
 *     def from_components(components):             # <<<<<<<<<<<<<<
 *         """
 *         Reconstruct SerializedPyObject from output of
 */
  __pyx_tuple__342 = PyTuple_Pack(5, __pyx_n_s_components, __pyx_n_s_num_tensors, __pyx_n_s_num_buffers, __pyx_n_s_buffers, __pyx_n_s_result); if (unlikely(!__pyx_tuple__342)) __PYX_ERR(14, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__342);
  __Pyx_GIVEREF(__pyx_tuple__342);
  __pyx_codeobj__343 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__342, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_from_components, 275, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__343)) __PYX_ERR(14, 275, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":315
 * 
 * 
 * def serialize(object value, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence
 * 
 */
  __pyx_tuple__344 = PyTuple_Pack(4, __pyx_n_s_value, __pyx_n_s_context, __pyx_n_s_serialized, __pyx_n_s_wrapped_value); if (unlikely(!__pyx_tuple__344)) __PYX_ERR(14, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__344);
  __Pyx_GIVEREF(__pyx_tuple__344);
  __pyx_codeobj__345 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__344, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_serialize, 315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__345)) __PYX_ERR(14, 315, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":341
 * 
 * 
 * def serialize_to(object value, sink, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence to a file.
 * 
 */
  __pyx_tuple__346 = PyTuple_Pack(4, __pyx_n_s_value, __pyx_n_s_sink, __pyx_n_s_context, __pyx_n_s_serialized); if (unlikely(!__pyx_tuple__346)) __PYX_ERR(14, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__346);
  __Pyx_GIVEREF(__pyx_tuple__346);
  __pyx_codeobj__347 = (PyObject*)__Pyx_PyCode_New(3, 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_serialization_pxi, __pyx_n_s_serialize_to, 341, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__347)) __PYX_ERR(14, 341, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":358
 * 
 * 
 * def read_serialized(source, base=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Read serialized Python sequence from file-like object
 * 
 */
  __pyx_tuple__348 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_base, __pyx_n_s_stream, __pyx_n_s_serialized); if (unlikely(!__pyx_tuple__348)) __PYX_ERR(14, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__348);
  __Pyx_GIVEREF(__pyx_tuple__348);
  __pyx_codeobj__349 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 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_serialization_pxi, __pyx_n_s_read_serialized, 358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__349)) __PYX_ERR(14, 358, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":384
 * 
 * 
 * def deserialize_from(source, object base, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize a Python sequence from a file.
 * 
 */
  __pyx_tuple__350 = PyTuple_Pack(4, __pyx_n_s_source, __pyx_n_s_base, __pyx_n_s_context, __pyx_n_s_serialized); if (unlikely(!__pyx_tuple__350)) __PYX_ERR(14, 384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__350);
  __Pyx_GIVEREF(__pyx_tuple__350);
  __pyx_codeobj__351 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 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_serialization_pxi, __pyx_n_s_deserialize_from, 384, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__351)) __PYX_ERR(14, 384, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":406
 * 
 * 
 * def deserialize_components(components, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct Python object from output of SerializedPyObject.to_components
 */
  __pyx_tuple__352 = PyTuple_Pack(3, __pyx_n_s_components, __pyx_n_s_context, __pyx_n_s_serialized); if (unlikely(!__pyx_tuple__352)) __PYX_ERR(14, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__352);
  __Pyx_GIVEREF(__pyx_tuple__352);
  __pyx_codeobj__353 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__352, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_deserialize_components, 406, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__353)) __PYX_ERR(14, 406, __pyx_L1_error)

  /* "pyarrow/serialization.pxi":424
 * 
 * 
 * def deserialize(obj, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     EXPERIMENTAL: Deserialize Python object from Buffer or other Python object
 */
  __pyx_tuple__354 = PyTuple_Pack(3, __pyx_n_s_obj, __pyx_n_s_context, __pyx_n_s_source); if (unlikely(!__pyx_tuple__354)) __PYX_ERR(14, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__354);
  __Pyx_GIVEREF(__pyx_tuple__354);
  __pyx_codeobj__355 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__354, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyarrow_serialization_pxi, __pyx_n_s_deserialize, 424, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__355)) __PYX_ERR(14, 424, __pyx_L1_error)

  /* "pyarrow/benchmark.pxi":19
 * 
 * 
 * def benchmark_PandasObjectIsNull(list obj):             # <<<<<<<<<<<<<<
 *     Benchmark_PandasObjectIsNull(obj)
 */
  __pyx_tuple__356 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__356)) __PYX_ERR(15, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__356);
  __Pyx_GIVEREF(__pyx_tuple__356);
  __pyx_codeobj__357 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 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_benchmark_pxi, __pyx_n_s_benchmark_PandasObjectIsNull, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__357)) __PYX_ERR(15, 19, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __pyx_unpickle_SerializationContext(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     if __pyx_checksum != 0x9aeed6f:
 *         from pickle import PickleError as __pyx_PickleError
 */
  __pyx_tuple__358 = 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__358)) __PYX_ERR(8, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__358);
  __Pyx_GIVEREF(__pyx_tuple__358);
  __pyx_codeobj__359 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 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_stringsource, __pyx_n_s_pyx_unpickle_SerializationCont, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__359)) __PYX_ERR(8, 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_items.type = (PyObject*)&PyDict_Type;
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(6, 1, __pyx_L1_error);
  __pyx_float_1e3 = PyFloat_FromDouble(1e3); if (unlikely(!__pyx_float_1e3)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_float_1e6 = PyFloat_FromDouble(1e6); if (unlikely(!__pyx_float_1e6)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_float_0_01 = PyFloat_FromDouble(0.01); if (unlikely(!__pyx_float_0_01)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_int_1970 = PyInt_FromLong(1970); if (unlikely(!__pyx_int_1970)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_int_65536 = PyInt_FromLong(65536L); if (unlikely(!__pyx_int_65536)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_int_86400 = PyInt_FromLong(86400L); if (unlikely(!__pyx_int_86400)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_int_1000000 = PyInt_FromLong(1000000L); if (unlikely(!__pyx_int_1000000)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_int_162458991 = PyInt_FromLong(162458991L); if (unlikely(!__pyx_int_162458991)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_int_1000000000 = PyInt_FromLong(1000000000L); if (unlikely(!__pyx_int_1000000000)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(6, 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__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__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__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("check_status", (void (*)(void))__pyx_f_7pyarrow_3lib_check_status, "int (arrow::Status const &)") < 0) __PYX_ERR(6, 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(6, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("wrap_array_output", (void (*)(void))__pyx_f_7pyarrow_3lib_wrap_array_output, "PyObject *(PyObject *)") < 0) __PYX_ERR(6, 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(6, 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(6, 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(6, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("box_metadata", (void (*)(void))__pyx_f_7pyarrow_3lib_box_metadata, "PyObject *( arrow::KeyValueMetadata const *)") < 0) __PYX_ERR(6, 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(6, 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(6, 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(6, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_column", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_wrap_column, "PyObject *(std::shared_ptr< arrow::Column>  const &)") < 0) __PYX_ERR(6, 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(6, 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(6, 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(6, 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(6, 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(6, 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(6, 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(6, 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(6, 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(6, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_unwrap_column", (void (*)(void))__pyx_f_7pyarrow_3lib_pyarrow_unwrap_column, "std::shared_ptr< arrow::Column>  (PyObject *)") < 0) __PYX_ERR(6, 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(6, 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(6, 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(6, 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(6, 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(6, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_buffer", (void (*)(void))pyarrow_is_buffer, "int (PyObject *)") < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_data_type", (void (*)(void))pyarrow_is_data_type, "int (PyObject *)") < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_field", (void (*)(void))pyarrow_is_field, "int (PyObject *)") < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_schema", (void (*)(void))pyarrow_is_schema, "int (PyObject *)") < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_array", (void (*)(void))pyarrow_is_array, "int (PyObject *)") < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_wrap_chunked_array", (void (*)(void))pyarrow_wrap_chunked_array, "PyObject *(std::shared_ptr< arrow::ChunkedArray>  const &)") < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_tensor", (void (*)(void))pyarrow_is_tensor, "int (PyObject *)") < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_column", (void (*)(void))pyarrow_is_column, "int (PyObject *)") < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_table", (void (*)(void))pyarrow_is_table, "int (PyObject *)") < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("pyarrow_is_batch", (void (*)(void))pyarrow_is_batch, "int (PyObject *)") < 0) __PYX_ERR(6, 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(5, 18, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Message.tp_print = 0;
  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(5, 18, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Message) < 0) __PYX_ERR(5, 18, __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(7, 23, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_MemoryPool.tp_print = 0;
  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(7, 23, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MemoryPool, (PyObject *)&__pyx_type_7pyarrow_3lib_MemoryPool) < 0) __PYX_ERR(7, 23, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_MemoryPool) < 0) __PYX_ERR(7, 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;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_DataType) < 0) __PYX_ERR(3, 89, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_DataType.tp_print = 0;
  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(3, 89, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DataType, (PyObject *)&__pyx_type_7pyarrow_3lib_DataType) < 0) __PYX_ERR(3, 89, __pyx_L1_error)
  __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(3, 192, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_ListType.tp_print = 0;
  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(3, 192, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ListType, (PyObject *)&__pyx_type_7pyarrow_3lib_ListType) < 0) __PYX_ERR(3, 192, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ListType = &__pyx_type_7pyarrow_3lib_ListType;
  __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(3, 170, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_DictionaryType.tp_print = 0;
  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(3, 170, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DictionaryType, (PyObject *)&__pyx_type_7pyarrow_3lib_DictionaryType) < 0) __PYX_ERR(3, 170, __pyx_L1_error)
  __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(3, 264, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_TimestampType.tp_print = 0;
  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(3, 264, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TimestampType, (PyObject *)&__pyx_type_7pyarrow_3lib_TimestampType) < 0) __PYX_ERR(3, 264, __pyx_L1_error)
  __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(3, 295, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Time32Type.tp_print = 0;
  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(3, 295, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time32Type, (PyObject *)&__pyx_type_7pyarrow_3lib_Time32Type) < 0) __PYX_ERR(3, 295, __pyx_L1_error)
  __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(3, 306, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Time64Type.tp_print = 0;
  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(3, 306, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time64Type, (PyObject *)&__pyx_type_7pyarrow_3lib_Time64Type) < 0) __PYX_ERR(3, 306, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Time64Type = &__pyx_type_7pyarrow_3lib_Time64Type;
  __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(3, 317, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryType.tp_print = 0;
  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(3, 317, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeBinaryType, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeBinaryType) < 0) __PYX_ERR(3, 317, __pyx_L1_error)
  __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(3, 332, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Decimal128Type.tp_print = 0;
  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(3, 332, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Decimal128Type, (PyObject *)&__pyx_type_7pyarrow_3lib_Decimal128Type) < 0) __PYX_ERR(3, 332, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Decimal128Type = &__pyx_type_7pyarrow_3lib_Decimal128Type;
  __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(3, 350, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Field.tp_print = 0;
  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(3, 350, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Field, (PyObject *)&__pyx_type_7pyarrow_3lib_Field) < 0) __PYX_ERR(3, 350, __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(3, 467, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Schema.tp_print = 0;
  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(3, 467, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Schema, (PyObject *)&__pyx_type_7pyarrow_3lib_Schema) < 0) __PYX_ERR(3, 467, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Schema = &__pyx_type_7pyarrow_3lib_Schema;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Scalar) < 0) __PYX_ERR(11, 111, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Scalar.tp_print = 0;
  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(11, 111, __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(11, 116, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_NAType.tp_print = 0;
  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(11, 116, __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(1, 43, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_ArrayValue.tp_print = 0;
  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(1, 43, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ArrayValue, (PyObject *)&__pyx_type_7pyarrow_3lib_ArrayValue) < 0) __PYX_ERR(1, 43, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_ArrayValue) < 0) __PYX_ERR(1, 43, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ArrayValue = &__pyx_type_7pyarrow_3lib_ArrayValue;
  __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(1, 91, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Int8Value.tp_print = 0;
  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(1, 91, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int8Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Int8Value) < 0) __PYX_ERR(1, 91, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int8Value) < 0) __PYX_ERR(1, 91, __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(1, 133, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Int64Value.tp_print = 0;
  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(1, 133, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int64Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Int64Value) < 0) __PYX_ERR(1, 133, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int64Value) < 0) __PYX_ERR(1, 133, __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(1, 306, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_ListValue.tp_print = 0;
  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 (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_ListValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_ListValue) < 0) __PYX_ERR(1, 306, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ListValue, (PyObject *)&__pyx_type_7pyarrow_3lib_ListValue) < 0) __PYX_ERR(1, 306, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_ListValue) < 0) __PYX_ERR(1, 306, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ListValue = &__pyx_type_7pyarrow_3lib_ListValue;
  __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(1, 376, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_StructValue.tp_print = 0;
  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 (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_StructValue.tp_dict, __pyx_vtabptr_7pyarrow_3lib_StructValue) < 0) __PYX_ERR(1, 376, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StructValue, (PyObject *)&__pyx_type_7pyarrow_3lib_StructValue) < 0) __PYX_ERR(1, 376, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_StructValue) < 0) __PYX_ERR(1, 376, __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(1, 342, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_UnionValue.tp_print = 0;
  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(1, 342, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnionValue, (PyObject *)&__pyx_type_7pyarrow_3lib_UnionValue) < 0) __PYX_ERR(1, 342, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UnionValue) < 0) __PYX_ERR(1, 342, __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(1, 287, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_StringValue.tp_print = 0;
  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(1, 287, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StringValue, (PyObject *)&__pyx_type_7pyarrow_3lib_StringValue) < 0) __PYX_ERR(1, 287, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_StringValue) < 0) __PYX_ERR(1, 287, __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(1, 361, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryValue.tp_print = 0;
  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(1, 361, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeBinaryValue, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue) < 0) __PYX_ERR(1, 361, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue) < 0) __PYX_ERR(1, 361, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_FixedSizeBinaryValue = &__pyx_type_7pyarrow_3lib_FixedSizeBinaryValue;
  __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;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Array) < 0) __PYX_ERR(2, 340, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Array.tp_print = 0;
  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 (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Array.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Array) < 0) __PYX_ERR(2, 340, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Array) < 0) __PYX_ERR(2, 340, __pyx_L1_error)
  __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(2, 713, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Tensor.tp_print = 0;
  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(2, 713, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Tensor, (PyObject *)&__pyx_type_7pyarrow_3lib_Tensor) < 0) __PYX_ERR(2, 713, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Tensor) < 0) __PYX_ERR(2, 713, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Tensor = &__pyx_type_7pyarrow_3lib_Tensor;
  __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(2, 819, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_NullArray.tp_print = 0;
  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(2, 819, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NullArray, (PyObject *)&__pyx_type_7pyarrow_3lib_NullArray) < 0) __PYX_ERR(2, 819, __pyx_L1_error)
  __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(2, 823, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_BooleanArray.tp_print = 0;
  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(2, 823, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BooleanArray, (PyObject *)&__pyx_type_7pyarrow_3lib_BooleanArray) < 0) __PYX_ERR(2, 823, __pyx_L1_error)
  __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(2, 827, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_NumericArray.tp_print = 0;
  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(2, 827, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NumericArray, (PyObject *)&__pyx_type_7pyarrow_3lib_NumericArray) < 0) __PYX_ERR(2, 827, __pyx_L1_error)
  __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(2, 831, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_IntegerArray.tp_print = 0;
  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(2, 831, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IntegerArray, (PyObject *)&__pyx_type_7pyarrow_3lib_IntegerArray) < 0) __PYX_ERR(2, 831, __pyx_L1_error)
  __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(2, 835, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_FloatingPointArray.tp_print = 0;
  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(2, 835, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FloatingPointArray, (PyObject *)&__pyx_type_7pyarrow_3lib_FloatingPointArray) < 0) __PYX_ERR(2, 835, __pyx_L1_error)
  __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(2, 839, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Int8Array.tp_print = 0;
  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(2, 839, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int8Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Int8Array) < 0) __PYX_ERR(2, 839, __pyx_L1_error)
  __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(2, 843, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_UInt8Array.tp_print = 0;
  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(2, 843, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt8Array, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt8Array) < 0) __PYX_ERR(2, 843, __pyx_L1_error)
  __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(2, 847, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Int16Array.tp_print = 0;
  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(2, 847, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int16Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Int16Array) < 0) __PYX_ERR(2, 847, __pyx_L1_error)
  __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(2, 851, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_UInt16Array.tp_print = 0;
  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(2, 851, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt16Array, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt16Array) < 0) __PYX_ERR(2, 851, __pyx_L1_error)
  __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(2, 855, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Int32Array.tp_print = 0;
  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(2, 855, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int32Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Int32Array) < 0) __PYX_ERR(2, 855, __pyx_L1_error)
  __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(2, 859, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_UInt32Array.tp_print = 0;
  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(2, 859, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt32Array, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt32Array) < 0) __PYX_ERR(2, 859, __pyx_L1_error)
  __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(2, 863, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Int64Array.tp_print = 0;
  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(2, 863, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int64Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Int64Array) < 0) __PYX_ERR(2, 863, __pyx_L1_error)
  __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(2, 867, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_UInt64Array.tp_print = 0;
  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(2, 867, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt64Array, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt64Array) < 0) __PYX_ERR(2, 867, __pyx_L1_error)
  __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(2, 891, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_HalfFloatArray.tp_print = 0;
  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(2, 891, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HalfFloatArray, (PyObject *)&__pyx_type_7pyarrow_3lib_HalfFloatArray) < 0) __PYX_ERR(2, 891, __pyx_L1_error)
  __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(2, 895, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_FloatArray.tp_print = 0;
  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(2, 895, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FloatArray, (PyObject *)&__pyx_type_7pyarrow_3lib_FloatArray) < 0) __PYX_ERR(2, 895, __pyx_L1_error)
  __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(2, 899, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_DoubleArray.tp_print = 0;
  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(2, 899, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DoubleArray, (PyObject *)&__pyx_type_7pyarrow_3lib_DoubleArray) < 0) __PYX_ERR(2, 899, __pyx_L1_error)
  __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(2, 903, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_FixedSizeBinaryArray.tp_print = 0;
  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(2, 903, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeBinaryArray, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeBinaryArray) < 0) __PYX_ERR(2, 903, __pyx_L1_error)
  __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(2, 907, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Decimal128Array.tp_print = 0;
  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(2, 907, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Decimal128Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Decimal128Array) < 0) __PYX_ERR(2, 907, __pyx_L1_error)
  __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(2, 1129, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_StructArray.tp_print = 0;
  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(2, 1129, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StructArray, (PyObject *)&__pyx_type_7pyarrow_3lib_StructArray) < 0) __PYX_ERR(2, 1129, __pyx_L1_error)
  __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(2, 911, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_ListArray.tp_print = 0;
  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(2, 911, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ListArray, (PyObject *)&__pyx_type_7pyarrow_3lib_ListArray) < 0) __PYX_ERR(2, 911, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ListArray = &__pyx_type_7pyarrow_3lib_ListArray;
  __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(2, 941, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_UnionArray.tp_print = 0;
  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(2, 941, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnionArray, (PyObject *)&__pyx_type_7pyarrow_3lib_UnionArray) < 0) __PYX_ERR(2, 941, __pyx_L1_error)
  __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(2, 994, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_StringArray.tp_print = 0;
  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(2, 994, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StringArray, (PyObject *)&__pyx_type_7pyarrow_3lib_StringArray) < 0) __PYX_ERR(2, 994, __pyx_L1_error)
  __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(2, 1032, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_BinaryArray.tp_print = 0;
  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(2, 1032, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BinaryArray, (PyObject *)&__pyx_type_7pyarrow_3lib_BinaryArray) < 0) __PYX_ERR(2, 1032, __pyx_L1_error)
  __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(2, 1036, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_DictionaryArray.tp_print = 0;
  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(2, 1036, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DictionaryArray, (PyObject *)&__pyx_type_7pyarrow_3lib_DictionaryArray) < 0) __PYX_ERR(2, 1036, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_DictionaryArray = &__pyx_type_7pyarrow_3lib_DictionaryArray;
  __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;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_ChunkedArray) < 0) __PYX_ERR(10, 31, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_ChunkedArray.tp_print = 0;
  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(10, 31, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ChunkedArray, (PyObject *)&__pyx_type_7pyarrow_3lib_ChunkedArray) < 0) __PYX_ERR(10, 31, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ChunkedArray = &__pyx_type_7pyarrow_3lib_ChunkedArray;
  __pyx_vtabptr_7pyarrow_3lib_Column = &__pyx_vtable_7pyarrow_3lib_Column;
  __pyx_vtable_7pyarrow_3lib_Column.init = (void (*)(struct __pyx_obj_7pyarrow_3lib_Column *, std::shared_ptr< arrow::Column>  const &))__pyx_f_7pyarrow_3lib_6Column_init;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Column) < 0) __PYX_ERR(10, 382, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Column.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib_Column.tp_dictoffset && __pyx_type_7pyarrow_3lib_Column.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib_Column.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_Column.tp_dict, __pyx_vtabptr_7pyarrow_3lib_Column) < 0) __PYX_ERR(10, 382, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Column, (PyObject *)&__pyx_type_7pyarrow_3lib_Column) < 0) __PYX_ERR(10, 382, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Column = &__pyx_type_7pyarrow_3lib_Column;
  __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;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_Table) < 0) __PYX_ERR(10, 1028, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Table.tp_print = 0;
  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(10, 1028, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Table, (PyObject *)&__pyx_type_7pyarrow_3lib_Table) < 0) __PYX_ERR(10, 1028, __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;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_RecordBatch) < 0) __PYX_ERR(10, 690, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_RecordBatch.tp_print = 0;
  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(10, 690, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatch, (PyObject *)&__pyx_type_7pyarrow_3lib_RecordBatch) < 0) __PYX_ERR(10, 690, __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(4, 725, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Buffer.tp_print = 0;
  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(4, 725, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Buffer, (PyObject *)&__pyx_type_7pyarrow_3lib_Buffer) < 0) __PYX_ERR(4, 725, __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(4, 875, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_ResizableBuffer.tp_print = 0;
  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(4, 875, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ResizableBuffer, (PyObject *)&__pyx_type_7pyarrow_3lib_ResizableBuffer) < 0) __PYX_ERR(4, 875, __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.read_handle = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr<arrow::io::RandomAccessFile>  *))__pyx_f_7pyarrow_3lib_10NativeFile_read_handle;
  __pyx_vtable_7pyarrow_3lib_NativeFile.write_handle = (PyObject *(*)(struct __pyx_obj_7pyarrow_3lib_NativeFile *, std::shared_ptr<arrow::io::OutputStream>  *))__pyx_f_7pyarrow_3lib_10NativeFile_write_handle;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_NativeFile) < 0) __PYX_ERR(4, 45, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_NativeFile.tp_print = 0;
  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(4, 45, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NativeFile, (PyObject *)&__pyx_type_7pyarrow_3lib_NativeFile) < 0) __PYX_ERR(4, 45, __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(4, 45, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_NativeFile = &__pyx_type_7pyarrow_3lib_NativeFile;
  __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(7, 43, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_LoggingMemoryPool.tp_print = 0;
  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(7, 43, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LoggingMemoryPool, (PyObject *)&__pyx_type_7pyarrow_3lib_LoggingMemoryPool) < 0) __PYX_ERR(7, 43, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_LoggingMemoryPool) < 0) __PYX_ERR(7, 43, __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(7, 56, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_ProxyMemoryPool.tp_print = 0;
  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(7, 56, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ProxyMemoryPool, (PyObject *)&__pyx_type_7pyarrow_3lib_ProxyMemoryPool) < 0) __PYX_ERR(7, 56, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_ProxyMemoryPool) < 0) __PYX_ERR(7, 56, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_ProxyMemoryPool = &__pyx_type_7pyarrow_3lib_ProxyMemoryPool;
  __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_type_7pyarrow_3lib_StructType.tp_base = __pyx_ptype_7pyarrow_3lib_DataType;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_StructType) < 0) __PYX_ERR(3, 206, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_StructType.tp_print = 0;
  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 (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_StructType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_StructType) < 0) __PYX_ERR(3, 206, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_StructType, (PyObject *)&__pyx_type_7pyarrow_3lib_StructType) < 0) __PYX_ERR(3, 206, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_StructType = &__pyx_type_7pyarrow_3lib_StructType;
  __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(3, 230, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_UnionType.tp_print = 0;
  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 (__Pyx_SetVtable(__pyx_type_7pyarrow_3lib_UnionType.tp_dict, __pyx_vtabptr_7pyarrow_3lib_UnionType) < 0) __PYX_ERR(3, 230, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UnionType, (PyObject *)&__pyx_type_7pyarrow_3lib_UnionType) < 0) __PYX_ERR(3, 230, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_UnionType = &__pyx_type_7pyarrow_3lib_UnionType;
  __pyx_type_7pyarrow_3lib_NullType.tp_base = __pyx_ptype_7pyarrow_3lib_Scalar;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_NullType) < 0) __PYX_ERR(1, 22, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_NullType.tp_print = 0;
  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(1, 22, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_NullType) < 0) __PYX_ERR(1, 22, __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(1, 84, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_BooleanValue.tp_print = 0;
  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(1, 84, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BooleanValue, (PyObject *)&__pyx_type_7pyarrow_3lib_BooleanValue) < 0) __PYX_ERR(1, 84, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BooleanValue) < 0) __PYX_ERR(1, 84, __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(1, 98, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_UInt8Value.tp_print = 0;
  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(1, 98, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt8Value, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt8Value) < 0) __PYX_ERR(1, 98, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt8Value) < 0) __PYX_ERR(1, 98, __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(1, 105, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Int16Value.tp_print = 0;
  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(1, 105, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int16Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Int16Value) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int16Value) < 0) __PYX_ERR(1, 105, __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(1, 112, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_UInt16Value.tp_print = 0;
  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(1, 112, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt16Value, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt16Value) < 0) __PYX_ERR(1, 112, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt16Value) < 0) __PYX_ERR(1, 112, __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(1, 119, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Int32Value.tp_print = 0;
  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(1, 119, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Int32Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Int32Value) < 0) __PYX_ERR(1, 119, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Int32Value) < 0) __PYX_ERR(1, 119, __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(1, 126, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_UInt32Value.tp_print = 0;
  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(1, 126, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt32Value, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt32Value) < 0) __PYX_ERR(1, 126, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt32Value) < 0) __PYX_ERR(1, 126, __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(1, 140, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_UInt64Value.tp_print = 0;
  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(1, 140, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_UInt64Value, (PyObject *)&__pyx_type_7pyarrow_3lib_UInt64Value) < 0) __PYX_ERR(1, 140, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_UInt64Value) < 0) __PYX_ERR(1, 140, __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(1, 147, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Date32Value.tp_print = 0;
  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(1, 147, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Date32Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Date32Value) < 0) __PYX_ERR(1, 147, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Date32Value) < 0) __PYX_ERR(1, 147, __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(1, 157, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Date64Value.tp_print = 0;
  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(1, 157, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Date64Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Date64Value) < 0) __PYX_ERR(1, 157, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Date64Value) < 0) __PYX_ERR(1, 157, __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(1, 165, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Time32Value.tp_print = 0;
  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(1, 165, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time32Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Time32Value) < 0) __PYX_ERR(1, 165, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Time32Value) < 0) __PYX_ERR(1, 165, __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(1, 180, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Time64Value.tp_print = 0;
  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(1, 180, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time64Value, (PyObject *)&__pyx_type_7pyarrow_3lib_Time64Value) < 0) __PYX_ERR(1, 180, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_Time64Value) < 0) __PYX_ERR(1, 180, __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(1, 229, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_TimestampValue.tp_print = 0;
  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(1, 229, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TimestampValue, (PyObject *)&__pyx_type_7pyarrow_3lib_TimestampValue) < 0) __PYX_ERR(1, 229, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_TimestampValue) < 0) __PYX_ERR(1, 229, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_TimestampValue = &__pyx_type_7pyarrow_3lib_TimestampValue;
  __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(1, 257, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_HalfFloatValue.tp_print = 0;
  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(1, 257, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HalfFloatValue, (PyObject *)&__pyx_type_7pyarrow_3lib_HalfFloatValue) < 0) __PYX_ERR(1, 257, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_HalfFloatValue) < 0) __PYX_ERR(1, 257, __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(1, 264, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_FloatValue.tp_print = 0;
  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(1, 264, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FloatValue, (PyObject *)&__pyx_type_7pyarrow_3lib_FloatValue) < 0) __PYX_ERR(1, 264, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FloatValue) < 0) __PYX_ERR(1, 264, __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(1, 271, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_DoubleValue.tp_print = 0;
  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(1, 271, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DoubleValue, (PyObject *)&__pyx_type_7pyarrow_3lib_DoubleValue) < 0) __PYX_ERR(1, 271, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DoubleValue) < 0) __PYX_ERR(1, 271, __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(1, 278, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_DecimalValue.tp_print = 0;
  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(1, 278, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DecimalValue, (PyObject *)&__pyx_type_7pyarrow_3lib_DecimalValue) < 0) __PYX_ERR(1, 278, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DecimalValue) < 0) __PYX_ERR(1, 278, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_DecimalValue = &__pyx_type_7pyarrow_3lib_DecimalValue;
  __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(1, 294, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_BinaryValue.tp_print = 0;
  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(1, 294, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BinaryValue, (PyObject *)&__pyx_type_7pyarrow_3lib_BinaryValue) < 0) __PYX_ERR(1, 294, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_BinaryValue) < 0) __PYX_ERR(1, 294, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_BinaryValue = &__pyx_type_7pyarrow_3lib_BinaryValue;
  __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(1, 410, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_DictionaryValue.tp_print = 0;
  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(1, 410, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_DictionaryValue, (PyObject *)&__pyx_type_7pyarrow_3lib_DictionaryValue) < 0) __PYX_ERR(1, 410, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_DictionaryValue) < 0) __PYX_ERR(1, 410, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_DictionaryValue = &__pyx_type_7pyarrow_3lib_DictionaryValue;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__FunctionContext) < 0) __PYX_ERR(2, 238, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib__FunctionContext.tp_print = 0;
  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(2, 238, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__FunctionContext) < 0) __PYX_ERR(2, 238, __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(2, 871, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Date32Array.tp_print = 0;
  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(2, 871, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Date32Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Date32Array) < 0) __PYX_ERR(2, 871, __pyx_L1_error)
  __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(2, 875, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Date64Array.tp_print = 0;
  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(2, 875, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Date64Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Date64Array) < 0) __PYX_ERR(2, 875, __pyx_L1_error)
  __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(2, 879, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_TimestampArray.tp_print = 0;
  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(2, 879, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TimestampArray, (PyObject *)&__pyx_type_7pyarrow_3lib_TimestampArray) < 0) __PYX_ERR(2, 879, __pyx_L1_error)
  __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(2, 883, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Time32Array.tp_print = 0;
  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(2, 883, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time32Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Time32Array) < 0) __PYX_ERR(2, 883, __pyx_L1_error)
  __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(2, 887, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_Time64Array.tp_print = 0;
  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(2, 887, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Time64Array, (PyObject *)&__pyx_type_7pyarrow_3lib_Time64Array) < 0) __PYX_ERR(2, 887, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_Time64Array = &__pyx_type_7pyarrow_3lib_Time64Array;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_StringBuilder) < 0) __PYX_ERR(9, 23, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_StringBuilder.tp_print = 0;
  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(9, 23, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_StringBuilder) < 0) __PYX_ERR(9, 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(4, 507, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_PythonFile.tp_print = 0;
  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(4, 507, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PythonFile, (PyObject *)&__pyx_type_7pyarrow_3lib_PythonFile) < 0) __PYX_ERR(4, 507, __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(4, 507, __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(4, 547, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_MemoryMappedFile.tp_print = 0;
  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(4, 547, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MemoryMappedFile, (PyObject *)&__pyx_type_7pyarrow_3lib_MemoryMappedFile) < 0) __PYX_ERR(4, 547, __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(4, 547, __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(4, 655, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_OSFile.tp_print = 0;
  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(4, 655, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_OSFile, (PyObject *)&__pyx_type_7pyarrow_3lib_OSFile) < 0) __PYX_ERR(4, 655, __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(4, 655, __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(4, 698, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_FixedSizeBufferWriter.tp_print = 0;
  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(4, 698, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FixedSizeBufferWriter, (PyObject *)&__pyx_type_7pyarrow_3lib_FixedSizeBufferWriter) < 0) __PYX_ERR(4, 698, __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(4, 698, __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(4, 937, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_BufferOutputStream.tp_print = 0;
  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(4, 937, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BufferOutputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_BufferOutputStream) < 0) __PYX_ERR(4, 937, __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(4, 937, __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(4, 963, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_MockOutputStream.tp_print = 0;
  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(4, 963, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MockOutputStream, (PyObject *)&__pyx_type_7pyarrow_3lib_MockOutputStream) < 0) __PYX_ERR(4, 963, __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(4, 963, __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(4, 974, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_BufferReader.tp_print = 0;
  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(4, 974, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_BufferReader, (PyObject *)&__pyx_type_7pyarrow_3lib_BufferReader) < 0) __PYX_ERR(4, 974, __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(4, 974, __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(12, 56, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_HadoopFileSystem.tp_print = 0;
  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(12, 56, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HadoopFileSystem, (PyObject *)&__pyx_type_7pyarrow_3lib_HadoopFileSystem) < 0) __PYX_ERR(12, 56, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_HadoopFileSystem) < 0) __PYX_ERR(12, 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(12, 464, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib__HdfsFileNanny.tp_print = 0;
  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(12, 464, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__HdfsFileNanny) < 0) __PYX_ERR(12, 464, __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(12, 483, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_HdfsFile.tp_print = 0;
  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(12, 483, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HdfsFile, (PyObject *)&__pyx_type_7pyarrow_3lib_HdfsFile) < 0) __PYX_ERR(12, 483, __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(12, 483, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_HdfsFile = &__pyx_type_7pyarrow_3lib_HdfsFile;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_MessageReader) < 0) __PYX_ERR(5, 100, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_MessageReader.tp_print = 0;
  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(5, 100, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_MessageReader) < 0) __PYX_ERR(5, 100, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib_MessageReader = &__pyx_type_7pyarrow_3lib_MessageReader;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__RecordBatchWriter) < 0) __PYX_ERR(5, 150, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib__RecordBatchWriter.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__RecordBatchWriter.tp_dictoffset && __pyx_type_7pyarrow_3lib__RecordBatchWriter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__RecordBatchWriter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatchWriter, (PyObject *)&__pyx_type_7pyarrow_3lib__RecordBatchWriter) < 0) __PYX_ERR(5, 150, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__RecordBatchWriter) < 0) __PYX_ERR(5, 150, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__RecordBatchWriter = &__pyx_type_7pyarrow_3lib__RecordBatchWriter;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__RecordBatchReader) < 0) __PYX_ERR(5, 244, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib__RecordBatchReader.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib__RecordBatchReader.tp_dictoffset && __pyx_type_7pyarrow_3lib__RecordBatchReader.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib__RecordBatchReader.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RecordBatchReader, (PyObject *)&__pyx_type_7pyarrow_3lib__RecordBatchReader) < 0) __PYX_ERR(5, 244, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__RecordBatchReader) < 0) __PYX_ERR(5, 244, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__RecordBatchReader = &__pyx_type_7pyarrow_3lib__RecordBatchReader;
  __pyx_type_7pyarrow_3lib__RecordBatchFileWriter.tp_base = __pyx_ptype_7pyarrow_3lib__RecordBatchWriter;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__RecordBatchFileWriter) < 0) __PYX_ERR(5, 310, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib__RecordBatchFileWriter.tp_print = 0;
  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(5, 310, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__RecordBatchFileWriter) < 0) __PYX_ERR(5, 310, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__RecordBatchFileWriter = &__pyx_type_7pyarrow_3lib__RecordBatchFileWriter;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib__RecordBatchFileReader) < 0) __PYX_ERR(5, 323, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib__RecordBatchFileReader.tp_print = 0;
  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(5, 323, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib__RecordBatchFileReader) < 0) __PYX_ERR(5, 323, __pyx_L1_error)
  __pyx_ptype_7pyarrow_3lib__RecordBatchFileReader = &__pyx_type_7pyarrow_3lib__RecordBatchFileReader;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib_FeatherWriter) < 0) __PYX_ERR(13, 26, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_FeatherWriter.tp_print = 0;
  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(13, 26, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FeatherWriter) < 0) __PYX_ERR(13, 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(13, 71, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_FeatherReader.tp_print = 0;
  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(13, 71, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_FeatherReader) < 0) __PYX_ERR(13, 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(14, 46, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_SerializationContext.tp_print = 0;
  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(14, 46, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_SerializationContext) < 0) __PYX_ERR(14, 46, __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(14, 216, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib_SerializedPyObject.tp_print = 0;
  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(14, 216, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SerializedPyObject, (PyObject *)&__pyx_type_7pyarrow_3lib_SerializedPyObject) < 0) __PYX_ERR(14, 216, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7pyarrow_3lib_SerializedPyObject) < 0) __PYX_ERR(14, 216, __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(3, 214, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib___pyx_scope_struct____iter__.tp_print = 0;
  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(3, 252, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_1___iter__.tp_print = 0;
  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(3, 483, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_2___iter__.tp_print = 0;
  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___iter__) < 0) __PYX_ERR(1, 314, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_3___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_3___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_3___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_3___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_3___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_3___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_4___iter__) < 0) __PYX_ERR(2, 524, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_4___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_4___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_4___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_4___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_4___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_4___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__) < 0) __PYX_ERR(10, 97, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_5___iter__.tp_print = 0;
  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_iterchunks) < 0) __PYX_ERR(10, 283, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_6_iterchunks.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_6_iterchunks.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_6_iterchunks.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_6_iterchunks.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_6_iterchunks = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_6_iterchunks;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_7_itercolumns) < 0) __PYX_ERR(10, 1498, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_7_itercolumns.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_7_itercolumns.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_7_itercolumns.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_7_itercolumns.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_7_itercolumns = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_7_itercolumns;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_8_download) < 0) __PYX_ERR(4, 366, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_8_download.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_8_download.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_8_download.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_8_download.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_8_download = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_8_download;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_9_upload) < 0) __PYX_ERR(4, 453, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_9_upload.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_9_upload.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_9_upload.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_9_upload.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_9_upload = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_9_upload;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_10___iter__) < 0) __PYX_ERR(5, 128, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_10___iter__.tp_print = 0;
  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___iter__) < 0) __PYX_ERR(5, 263, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_11___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_11___iter__.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_11___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_11___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_11___iter__ = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_11___iter__;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple) < 0) __PYX_ERR(14, 23, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_12_is_named_tuple;
  if (PyType_Ready(&__pyx_type_7pyarrow_3lib___pyx_scope_struct_13_genexpr) < 0) __PYX_ERR(14, 31, __pyx_L1_error)
  __pyx_type_7pyarrow_3lib___pyx_scope_struct_13_genexpr.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7pyarrow_3lib___pyx_scope_struct_13_genexpr.tp_dictoffset && __pyx_type_7pyarrow_3lib___pyx_scope_struct_13_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_7pyarrow_3lib___pyx_scope_struct_13_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_7pyarrow_3lib___pyx_scope_struct_13_genexpr = &__pyx_type_7pyarrow_3lib___pyx_scope_struct_13_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(17, 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(17, 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(18, 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(18, 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(19, 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(19, 15, __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) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        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__") < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 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(6, 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(6, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(6, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(6, 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(6, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(6, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(6, 1, __pyx_L1_error)
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(6, 1, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(6, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(6, 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(6, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_pyarrow__lib) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(6, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "pyarrow.lib")) {
      if (unlikely(PyDict_SetItemString(modules, "pyarrow.lib", __pyx_m) < 0)) __PYX_ERR(6, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(6, 1, __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(6, 1, __pyx_L1_error)
  #endif

  /* "pyarrow/lib.pyx":22
 * # cython: embedsignature = True
 * 
 * import datetime             # <<<<<<<<<<<<<<
 * import decimal as _pydecimal
 * import multiprocessing
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_datetime, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_1) < 0) __PYX_ERR(6, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":23
 * 
 * import datetime
 * import decimal as _pydecimal             # <<<<<<<<<<<<<<
 * import multiprocessing
 * import numpy as np
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_decimal, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pydecimal, __pyx_t_1) < 0) __PYX_ERR(6, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":24
 * import datetime
 * import decimal as _pydecimal
 * import multiprocessing             # <<<<<<<<<<<<<<
 * import numpy as np
 * import os
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_multiprocessing, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_multiprocessing, __pyx_t_1) < 0) __PYX_ERR(6, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":25
 * import decimal as _pydecimal
 * import multiprocessing
 * import numpy as np             # <<<<<<<<<<<<<<
 * import os
 * import six
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(6, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":26
 * import multiprocessing
 * import numpy as np
 * import os             # <<<<<<<<<<<<<<
 * import six
 * from pyarrow.compat import frombytes, tobytes, PandasSeries, Categorical
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(6, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":27
 * import numpy as np
 * import os
 * import six             # <<<<<<<<<<<<<<
 * from pyarrow.compat import frombytes, tobytes, PandasSeries, Categorical
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_six, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_six, __pyx_t_1) < 0) __PYX_ERR(6, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":28
 * import os
 * import six
 * from pyarrow.compat import frombytes, tobytes, PandasSeries, Categorical             # <<<<<<<<<<<<<<
 * 
 * from cython.operator cimport dereference as deref
 */
  __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 28, __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_PandasSeries);
  __Pyx_GIVEREF(__pyx_n_s_PandasSeries);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_PandasSeries);
  __Pyx_INCREF(__pyx_n_s_Categorical);
  __Pyx_GIVEREF(__pyx_n_s_Categorical);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_Categorical);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 28, __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(6, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_frombytes, __pyx_t_1) < 0) __PYX_ERR(6, 28, __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(6, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tobytes, __pyx_t_1) < 0) __PYX_ERR(6, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_PandasSeries); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PandasSeries, __pyx_t_1) < 0) __PYX_ERR(6, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Categorical); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Categorical, __pyx_t_1) < 0) __PYX_ERR(6, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/lib.pyx":36
 * cimport cpython as cp
 * 
 * arrow_init_numpy()             # <<<<<<<<<<<<<<
 * set_numpy_nan(np.nan)
 * 
 */
  __pyx_t_3 = arrow_init_numpy(); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 36, __pyx_L1_error)

  /* "pyarrow/lib.pyx":37
 * 
 * arrow_init_numpy()
 * set_numpy_nan(np.nan)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 37, __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(6, 37, __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":40
 * 
 * 
 * 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(6, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cpu_count, __pyx_t_1) < 0) __PYX_ERR(6, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":52
 * 
 * 
 * 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(6, 52, __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(6, 52, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":61
 * 
 * 
 * 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(6, 61, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_NA, __pyx_t_1) < 0) __PYX_ERR(6, 61, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":62
 * 
 * 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(6, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_BOOL, __pyx_t_1) < 0) __PYX_ERR(6, 62, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":63
 * 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(6, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UINT8, __pyx_t_1) < 0) __PYX_ERR(6, 63, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":64
 * 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(6, 64, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_INT8, __pyx_t_1) < 0) __PYX_ERR(6, 64, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":65
 * 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(6, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UINT16, __pyx_t_1) < 0) __PYX_ERR(6, 65, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":66
 * 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(6, 66, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_INT16, __pyx_t_1) < 0) __PYX_ERR(6, 66, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":67
 * 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(6, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UINT32, __pyx_t_1) < 0) __PYX_ERR(6, 67, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":68
 * 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(6, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_INT32, __pyx_t_1) < 0) __PYX_ERR(6, 68, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":69
 * 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(6, 69, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UINT64, __pyx_t_1) < 0) __PYX_ERR(6, 69, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":70
 * 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(6, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_INT64, __pyx_t_1) < 0) __PYX_ERR(6, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":71
 * 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(6, 71, __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(6, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":72
 * 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(6, 72, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_FLOAT, __pyx_t_1) < 0) __PYX_ERR(6, 72, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":73
 * 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(6, 73, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DOUBLE, __pyx_t_1) < 0) __PYX_ERR(6, 73, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":74
 * 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(6, 74, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DECIMAL, __pyx_t_1) < 0) __PYX_ERR(6, 74, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":75
 * 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(6, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DATE32, __pyx_t_1) < 0) __PYX_ERR(6, 75, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":76
 * 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(6, 76, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DATE64, __pyx_t_1) < 0) __PYX_ERR(6, 76, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":77
 * 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(6, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_TIMESTAMP, __pyx_t_1) < 0) __PYX_ERR(6, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":78
 * Type_DATE64 = _Type_DATE64
 * Type_TIMESTAMP = _Type_TIMESTAMP
 * Type_TIME32 = _Type_TIME32             # <<<<<<<<<<<<<<
 * Type_TIME64 = _Type_TIME64
 * Type_BINARY = _Type_BINARY
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME32); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 78, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_TIME32, __pyx_t_1) < 0) __PYX_ERR(6, 78, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":79
 * Type_TIMESTAMP = _Type_TIMESTAMP
 * Type_TIME32 = _Type_TIME32
 * Type_TIME64 = _Type_TIME64             # <<<<<<<<<<<<<<
 * Type_BINARY = _Type_BINARY
 * Type_STRING = _Type_STRING
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME64); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_TIME64, __pyx_t_1) < 0) __PYX_ERR(6, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":80
 * Type_TIME32 = _Type_TIME32
 * Type_TIME64 = _Type_TIME64
 * Type_BINARY = _Type_BINARY             # <<<<<<<<<<<<<<
 * Type_STRING = _Type_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::BINARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_BINARY, __pyx_t_1) < 0) __PYX_ERR(6, 80, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":81
 * Type_TIME64 = _Type_TIME64
 * Type_BINARY = _Type_BINARY
 * Type_STRING = _Type_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::STRING); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 81, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_STRING, __pyx_t_1) < 0) __PYX_ERR(6, 81, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":82
 * Type_BINARY = _Type_BINARY
 * Type_STRING = _Type_STRING
 * Type_FIXED_SIZE_BINARY = _Type_FIXED_SIZE_BINARY             # <<<<<<<<<<<<<<
 * Type_LIST = _Type_LIST
 * Type_STRUCT = _Type_STRUCT
 */
  __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(6, 82, __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(6, 82, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":83
 * Type_STRING = _Type_STRING
 * Type_FIXED_SIZE_BINARY = _Type_FIXED_SIZE_BINARY
 * Type_LIST = _Type_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::LIST); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 83, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_LIST, __pyx_t_1) < 0) __PYX_ERR(6, 83, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":84
 * Type_FIXED_SIZE_BINARY = _Type_FIXED_SIZE_BINARY
 * Type_LIST = _Type_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(6, 84, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_STRUCT, __pyx_t_1) < 0) __PYX_ERR(6, 84, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":85
 * Type_LIST = _Type_LIST
 * Type_STRUCT = _Type_STRUCT
 * Type_UNION = _Type_UNION             # <<<<<<<<<<<<<<
 * Type_DICTIONARY = _Type_DICTIONARY
 * Type_MAP = _Type_MAP
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UNION); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_UNION, __pyx_t_1) < 0) __PYX_ERR(6, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":86
 * Type_STRUCT = _Type_STRUCT
 * Type_UNION = _Type_UNION
 * Type_DICTIONARY = _Type_DICTIONARY             # <<<<<<<<<<<<<<
 * Type_MAP = _Type_MAP
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DICTIONARY); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_DICTIONARY, __pyx_t_1) < 0) __PYX_ERR(6, 86, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":87
 * Type_UNION = _Type_UNION
 * Type_DICTIONARY = _Type_DICTIONARY
 * Type_MAP = _Type_MAP             # <<<<<<<<<<<<<<
 * 
 * UnionMode_SPARSE = _UnionMode_SPARSE
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::MAP); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Type_MAP, __pyx_t_1) < 0) __PYX_ERR(6, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":89
 * Type_MAP = _Type_MAP
 * 
 * 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(6, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnionMode_SPARSE, __pyx_t_1) < 0) __PYX_ERR(6, 89, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/lib.pyx":90
 * 
 * UnionMode_SPARSE = _UnionMode_SPARSE
 * UnionMode_DENSE = _UnionMode_DENSE             # <<<<<<<<<<<<<<
 * 
 * # Exception types
 */
  __pyx_t_1 = __Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type( arrow::UnionMode::DENSE); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnionMode_DENSE, __pyx_t_1) < 0) __PYX_ERR(6, 90, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/error.pxi":20
 * from pyarrow.includes.libarrow cimport CStatus
 * 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, -1); 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, 1); 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, 1); 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, 1); 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 ArrowIOError(IOError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __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_IOError);
  __Pyx_GIVEREF(__pyx_builtin_IOError);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_IOError);
  __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_ArrowIOError, __pyx_n_s_ArrowIOError, (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);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ArrowIOError, __pyx_t_1, __pyx_t_4, NULL, 0, 1); 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_ArrowIOError, __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":39
 * 
 * 
 * class ArrowKeyError(KeyError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_KeyError);
  __Pyx_GIVEREF(__pyx_builtin_KeyError);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_KeyError);
  __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, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __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, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ArrowKeyError, __pyx_t_2, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowKeyError, __pyx_t_5) < 0) __PYX_ERR(0, 39, __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":43
 * 
 * 
 * class ArrowTypeError(TypeError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_TypeError);
  __Pyx_GIVEREF(__pyx_builtin_TypeError);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_TypeError);
  __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, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __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, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ArrowTypeError, __pyx_t_1, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowTypeError, __pyx_t_5) < 0) __PYX_ERR(0, 43, __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":47
 * 
 * 
 * class ArrowNotImplementedError(NotImplementedError, ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_NotImplementedError);
  __Pyx_GIVEREF(__pyx_builtin_NotImplementedError);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_NotImplementedError);
  __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, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __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, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ArrowNotImplementedError, __pyx_t_2, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowNotImplementedError, __pyx_t_5) < 0) __PYX_ERR(0, 47, __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":51
 * 
 * 
 * class ArrowCapacityError(ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __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, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ArrowCapacityError, __pyx_t_1, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowCapacityError, __pyx_t_5) < 0) __PYX_ERR(0, 51, __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":55
 * 
 * 
 * class PlasmaObjectExists(ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __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, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_PlasmaObjectExists, __pyx_n_s_PlasmaObjectExists, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_PlasmaObjectExists, __pyx_t_2, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PlasmaObjectExists, __pyx_t_5) < 0) __PYX_ERR(0, 55, __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":59
 * 
 * 
 * class PlasmaObjectNonexistent(ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_PlasmaObjectNonexistent, __pyx_n_s_PlasmaObjectNonexistent, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_PlasmaObjectNonexistent, __pyx_t_1, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PlasmaObjectNonexistent, __pyx_t_5) < 0) __PYX_ERR(0, 59, __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":63
 * 
 * 
 * class PlasmaStoreFull(ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __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, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_PlasmaStoreFull, __pyx_n_s_PlasmaStoreFull, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_PlasmaStoreFull, __pyx_t_2, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 63, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PlasmaStoreFull, __pyx_t_5) < 0) __PYX_ERR(0, 63, __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":67
 * 
 * 
 * class ArrowSerializationError(ArrowException):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ArrowException); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __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, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ArrowSerializationError, __pyx_t_1, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ArrowSerializationError, __pyx_t_5) < 0) __PYX_ERR(0, 67, __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/memory.pxi":70
 * 
 * 
 * def default_memory_pool():             # <<<<<<<<<<<<<<
 *     cdef:
 *         MemoryPool pool = MemoryPool.__new__(MemoryPool)
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5default_memory_pool, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_memory_pool, __pyx_t_1) < 0) __PYX_ERR(7, 70, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":77
 * 
 * 
 * def proxy_memory_pool(MemoryPool parent):             # <<<<<<<<<<<<<<
 *     """
 *     Derived MemoryPool class that tracks the number of bytes and
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_7proxy_memory_pool, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_proxy_memory_pool, __pyx_t_1) < 0) __PYX_ERR(7, 77, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":88
 * 
 * 
 * def set_memory_pool(MemoryPool pool):             # <<<<<<<<<<<<<<
 *     c_set_default_memory_pool(pool.pool)
 * 
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_9set_memory_pool, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 88, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_memory_pool, __pyx_t_1) < 0) __PYX_ERR(7, 88, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":92
 * 
 * 
 * cdef MemoryPool _default_memory_pool = default_memory_pool()             # <<<<<<<<<<<<<<
 * cdef LoggingMemoryPool _logging_memory_pool = LoggingMemoryPool.__new__(
 *     LoggingMemoryPool, _default_memory_pool)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_default_memory_pool); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 92, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7pyarrow_3lib_MemoryPool))))) __PYX_ERR(7, 92, __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_2));
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pyarrow/memory.pxi":93
 * 
 * cdef MemoryPool _default_memory_pool = default_memory_pool()
 * cdef LoggingMemoryPool _logging_memory_pool = LoggingMemoryPool.__new__(             # <<<<<<<<<<<<<<
 *     LoggingMemoryPool, _default_memory_pool)
 * 
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_7pyarrow_3lib__default_memory_pool));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_7pyarrow_3lib__default_memory_pool));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_7pyarrow_3lib__default_memory_pool));
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_7pyarrow_3lib_LoggingMemoryPool(((PyTypeObject *)__pyx_ptype_7pyarrow_3lib_LoggingMemoryPool), __pyx_t_2, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 93, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __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_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":97
 * 
 * 
 * def log_memory_allocations(enable=True):             # <<<<<<<<<<<<<<
 *     """
 *     Enable or disable memory allocator logging for debugging purposes
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11log_memory_allocations, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_log_memory_allocations, __pyx_t_1) < 0) __PYX_ERR(7, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/memory.pxi":112
 * 
 * 
 * def total_allocated_bytes():             # <<<<<<<<<<<<<<
 *     cdef CMemoryPool* pool = c_get_memory_pool()
 *     return pool.bytes_allocated()
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_13total_allocated_bytes, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_total_allocated_bytes, __pyx_t_1) < 0) __PYX_ERR(7, 112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":18
 * # under the License.
 * 
 * import collections             # <<<<<<<<<<<<<<
 * import re
 * 
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(3, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":19
 * 
 * import collections
 * import re             # <<<<<<<<<<<<<<
 * 
 * # These are imprecise because the type (in pandas 0.x) depends on the presence
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) __PYX_ERR(3, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":24
 * # of nulls
 * cdef dict _pandas_type_map = {
 *     _Type_NA: np.float64,  # NaNs             # <<<<<<<<<<<<<<
 *     _Type_BOOL: np.bool_,
 *     _Type_INT8: np.int8,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(21); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::NA); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 24, __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(3, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_5) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":25
 * 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(3, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_bool); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":26
 *     _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(3, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int8); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":27
 *     _Type_BOOL: np.bool_,
 *     _Type_INT8: np.int8,
 *     _Type_INT16: np.int16,             # <<<<<<<<<<<<<<
 *     _Type_INT32: np.int32,
 *     _Type_INT64: np.int64,
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 27, __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(3, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_5) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":28
 *     _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(3, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":29
 *     _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(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int64); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":30
 *     _Type_INT32: np.int32,
 *     _Type_INT64: np.int64,
 *     _Type_UINT8: np.uint8,             # <<<<<<<<<<<<<<
 *     _Type_UINT16: np.uint16,
 *     _Type_UINT32: np.uint32,
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 30, __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(3, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_5) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":31
 *     _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(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_uint16); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(3, 24, __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_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(3, 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(3, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":33
 *     _Type_UINT16: np.uint16,
 *     _Type_UINT32: np.uint32,
 *     _Type_UINT64: np.uint64,             # <<<<<<<<<<<<<<
 *     _Type_HALF_FLOAT: np.float16,
 *     _Type_FLOAT: np.float32,
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 33, __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(3, 33, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_5) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":34
 *     _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(3, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float16); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_t_4) < 0) __PYX_ERR(3, 24, __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_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(3, 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(3, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_2) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":36
 *     _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_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 36, __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(3, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_5) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":37
 *     _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(3, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__197, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_t_2) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":38
 *     _Type_DOUBLE: np.float64,
 *     _Type_DATE32: np.dtype('datetime64[ns]'),
 *     _Type_DATE64: np.dtype('datetime64[ns]'),             # <<<<<<<<<<<<<<
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),
 *     _Type_BINARY: np.object_,
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DATE64); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 38, __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(3, 38, __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__197, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 38, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_5) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":39
 *     _Type_DATE32: np.dtype('datetime64[ns]'),
 *     _Type_DATE64: np.dtype('datetime64[ns]'),
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),             # <<<<<<<<<<<<<<
 *     _Type_BINARY: np.object_,
 *     _Type_FIXED_SIZE_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(3, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__197, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 39, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_t_2) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":40
 *     _Type_DATE64: np.dtype('datetime64[ns]'),
 *     _Type_TIMESTAMP: np.dtype('datetime64[ns]'),
 *     _Type_BINARY: np.object_,             # <<<<<<<<<<<<<<
 *     _Type_FIXED_SIZE_BINARY: np.object_,
 *     _Type_STRING: np.object_,
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BINARY); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_4) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":41
 *     _Type_TIMESTAMP: np.dtype('datetime64[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(3, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_5) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":42
 *     _Type_BINARY: np.object_,
 *     _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::STRING); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_object_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 42, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_t_2) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyarrow/types.pxi":43
 *     _Type_FIXED_SIZE_BINARY: np.object_,
 *     _Type_STRING: np.object_,
 *     _Type_LIST: np.object_,             # <<<<<<<<<<<<<<
 *     _Type_DECIMAL: np.object_,
 * }
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LIST); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_object_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 43, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_2, __pyx_t_4) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pyarrow/types.pxi":44
 *     _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(3, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_object_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_4, __pyx_t_5) < 0) __PYX_ERR(3, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__pandas_type_map);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__pandas_type_map, ((PyObject*)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":48
 * 
 * cdef dict _pep3118_type_map = {
 *     _Type_INT8: b'b',             # <<<<<<<<<<<<<<
 *     _Type_INT16: b'h',
 *     _Type_INT32: b'i',
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 48, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_b) < 0) __PYX_ERR(3, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":49
 * cdef dict _pep3118_type_map = {
 *     _Type_INT8: b'b',
 *     _Type_INT16: b'h',             # <<<<<<<<<<<<<<
 *     _Type_INT32: b'i',
 *     _Type_INT64: b'q',
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT16); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_h) < 0) __PYX_ERR(3, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":50
 *     _Type_INT8: b'b',
 *     _Type_INT16: b'h',
 *     _Type_INT32: b'i',             # <<<<<<<<<<<<<<
 *     _Type_INT64: b'q',
 *     _Type_UINT8: b'B',
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT32); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_i) < 0) __PYX_ERR(3, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":51
 *     _Type_INT16: b'h',
 *     _Type_INT32: b'i',
 *     _Type_INT64: b'q',             # <<<<<<<<<<<<<<
 *     _Type_UINT8: b'B',
 *     _Type_UINT16: b'H',
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT64); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 51, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_q) < 0) __PYX_ERR(3, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":52
 *     _Type_INT32: b'i',
 *     _Type_INT64: b'q',
 *     _Type_UINT8: b'B',             # <<<<<<<<<<<<<<
 *     _Type_UINT16: b'H',
 *     _Type_UINT32: b'I',
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT8); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 52, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_B) < 0) __PYX_ERR(3, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":53
 *     _Type_INT64: b'q',
 *     _Type_UINT8: b'B',
 *     _Type_UINT16: b'H',             # <<<<<<<<<<<<<<
 *     _Type_UINT32: b'I',
 *     _Type_UINT64: b'Q',
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT16); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_H) < 0) __PYX_ERR(3, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":54
 *     _Type_UINT8: b'B',
 *     _Type_UINT16: b'H',
 *     _Type_UINT32: b'I',             # <<<<<<<<<<<<<<
 *     _Type_UINT64: b'Q',
 *     _Type_HALF_FLOAT: b'e',
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT32); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 54, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_I) < 0) __PYX_ERR(3, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":55
 *     _Type_UINT16: b'H',
 *     _Type_UINT32: b'I',
 *     _Type_UINT64: b'Q',             # <<<<<<<<<<<<<<
 *     _Type_HALF_FLOAT: b'e',
 *     _Type_FLOAT: b'f',
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::UINT64); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_Q) < 0) __PYX_ERR(3, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":56
 *     _Type_UINT32: b'I',
 *     _Type_UINT64: b'Q',
 *     _Type_HALF_FLOAT: b'e',             # <<<<<<<<<<<<<<
 *     _Type_FLOAT: b'f',
 *     _Type_DOUBLE: b'd',
 */
  __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(3, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_e) < 0) __PYX_ERR(3, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":57
 *     _Type_UINT64: b'Q',
 *     _Type_HALF_FLOAT: b'e',
 *     _Type_FLOAT: b'f',             # <<<<<<<<<<<<<<
 *     _Type_DOUBLE: b'd',
 * }
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::FLOAT); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 57, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_f) < 0) __PYX_ERR(3, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyarrow/types.pxi":58
 *     _Type_HALF_FLOAT: b'e',
 *     _Type_FLOAT: b'f',
 *     _Type_DOUBLE: b'd',             # <<<<<<<<<<<<<<
 * }
 * 
 */
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 58, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_1, __pyx_t_5, __pyx_n_b_d) < 0) __PYX_ERR(3, 48, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib__pep3118_type_map);
  __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib__pep3118_type_map, ((PyObject*)__pyx_t_1));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":79
 * 
 * 
 * def _is_primitive(Type type):             # <<<<<<<<<<<<<<
 *     # This is simply a redirect, the official API is in pyarrow.types.
 *     return is_primitive(type)
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15_is_primitive, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_primitive, __pyx_t_1) < 0) __PYX_ERR(3, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":763
 * 
 * 
 * cdef dict _type_cache = {}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 763, __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":794
 * 
 * 
 * def field(name, type, bint nullable=True, dict metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Create a pyarrow.Field instance
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_17field, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_field, __pyx_t_1) < 0) __PYX_ERR(3, 794, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyarrow/types.pxi":836
 * 
 * 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(3, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BOOL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pyarrow/types.pxi":837
 * 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(3, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::INT8); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyarrow/types.pxi":838
 *     _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(3, 838, __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(3, 838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pyarrow/types.pxi":839
 *     _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(3, 839, __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(3, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);

  /* "pyarrow/types.pxi":840
 *     _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(3, 840, __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(3, 840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);

  /* "pyarrow/types.pxi":841
 *     _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(3, 841, __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(3, 841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_13);

  /* "pyarrow/types.pxi":842
 *     _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(3, 842, __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(3, 842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);

  /* "pyarrow/types.pxi":843
 *     _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(3, 843, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_16);

  /* "pyarrow/types.pxi":844
 *     _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(3, 844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_17);

  /* "pyarrow/types.pxi":845
 *     _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(3, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);

  /* "pyarrow/types.pxi":846
 *     _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(3, 846, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_20 = PySet_New(0); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PySet_Add(__pyx_t_20, __pyx_t_1) < 0) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_5) < 0) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_4) < 0) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_2) < 0) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_6) < 0) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_7) < 0) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_8) < 0) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_9) < 0) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_10) < 0) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_11) < 0) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_12) < 0) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_13) < 0) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_14) < 0) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_15) < 0) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_16) < 0) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_17) < 0) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_18) < 0) __PYX_ERR(3, 835, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PySet_Add(__pyx_t_20, __pyx_t_19) < 0) __PYX_ERR(3, 835, __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":849
 * 
 * 
 * def null():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of null type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_19null, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_null, __pyx_t_20) < 0) __PYX_ERR(3, 849, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":856
 * 
 * 
 * def bool_():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of boolean type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_21bool_, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_bool, __pyx_t_20) < 0) __PYX_ERR(3, 856, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":863
 * 
 * 
 * def uint8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned int8 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_23uint8, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uint8, __pyx_t_20) < 0) __PYX_ERR(3, 863, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":870
 * 
 * 
 * def int8():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int8 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_25int8, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int8, __pyx_t_20) < 0) __PYX_ERR(3, 870, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":877
 * 
 * 
 * def uint16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint16 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_27uint16, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uint16, __pyx_t_20) < 0) __PYX_ERR(3, 877, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":884
 * 
 * 
 * def int16():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int16 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_29int16, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int16, __pyx_t_20) < 0) __PYX_ERR(3, 884, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":891
 * 
 * 
 * def uint32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint32 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_31uint32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uint32, __pyx_t_20) < 0) __PYX_ERR(3, 891, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":898
 * 
 * 
 * def int32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int32 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_33int32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int32, __pyx_t_20) < 0) __PYX_ERR(3, 898, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":905
 * 
 * 
 * def uint64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of unsigned uint64 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_35uint64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uint64, __pyx_t_20) < 0) __PYX_ERR(3, 905, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":912
 * 
 * 
 * def int64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of signed int64 type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_37int64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 912, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_int64, __pyx_t_20) < 0) __PYX_ERR(3, 912, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":919
 * 
 * 
 * cdef dict _timestamp_type_cache = {}             # <<<<<<<<<<<<<<
 * cdef dict _time_type_cache = {}
 * 
 */
  __pyx_t_20 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 919, __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":920
 * 
 * cdef dict _timestamp_type_cache = {}
 * cdef dict _time_type_cache = {}             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_20 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 920, __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":934
 * 
 * 
 * _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(3, 934, __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(3, 934, __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__212, NULL); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 934, __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(3, 934, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":937
 * 
 * 
 * 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_39tzinfo_to_string, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 937, __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(3, 937, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":963
 * 
 * 
 * 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_41string_to_tzinfo, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 963, __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(3, 963, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":991
 * 
 * 
 * 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_43timestamp, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_timestamp, __pyx_t_20) < 0) __PYX_ERR(3, 991, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1046
 * 
 * 
 * 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_45time32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time32, __pyx_t_20) < 0) __PYX_ERR(3, 1046, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1084
 * 
 * 
 * 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_47time64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time64, __pyx_t_20) < 0) __PYX_ERR(3, 1084, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1122
 * 
 * 
 * def date32():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 32-bit date (days since UNIX epoch 1970-01-01)
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_49date32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_date32, __pyx_t_20) < 0) __PYX_ERR(3, 1122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1129
 * 
 * 
 * def date64():             # <<<<<<<<<<<<<<
 *     """
 *     Create instance of 64-bit date (milliseconds since UNIX epoch 1970-01-01)
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_51date64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_date64, __pyx_t_20) < 0) __PYX_ERR(3, 1129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1136
 * 
 * 
 * def float16():             # <<<<<<<<<<<<<<
 *     """
 *     Create half-precision floating point type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_53float16, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_float16, __pyx_t_20) < 0) __PYX_ERR(3, 1136, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1143
 * 
 * 
 * def float32():             # <<<<<<<<<<<<<<
 *     """
 *     Create single-precision floating point type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_55float32, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_float32, __pyx_t_20) < 0) __PYX_ERR(3, 1143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1150
 * 
 * 
 * def float64():             # <<<<<<<<<<<<<<
 *     """
 *     Create double-precision floating point type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_57float64, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_float64, __pyx_t_20) < 0) __PYX_ERR(3, 1150, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1175
 * 
 * 
 * def string():             # <<<<<<<<<<<<<<
 *     """
 *     Create UTF8 variable-length string type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_61string, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_string, __pyx_t_20) < 0) __PYX_ERR(3, 1175, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1182
 * 
 * 
 * def binary(int length=-1):             # <<<<<<<<<<<<<<
 *     """
 *     Create variable-length binary type
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_63binary, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1182, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_binary, __pyx_t_20) < 0) __PYX_ERR(3, 1182, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1254
 * 
 * 
 * def struct(fields):             # <<<<<<<<<<<<<<
 *     """
 *     Create StructType instance from fields
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_69struct, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_20) < 0) __PYX_ERR(3, 1254, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1302
 * 
 * 
 * def union(children_fields, mode):             # <<<<<<<<<<<<<<
 *     """
 *     Create UnionType from children fields.
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_71union, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_union, __pyx_t_20) < 0) __PYX_ERR(3, 1302, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1349
 * 
 * cdef dict _type_aliases = {
 *     'null': null,             # <<<<<<<<<<<<<<
 *     'bool': bool_,
 *     'i1': int8,
 */
  __pyx_t_20 = __Pyx_PyDict_NewPresized(43); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_null); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_null, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1350
 * cdef dict _type_aliases = {
 *     'null': null,
 *     'bool': bool_,             # <<<<<<<<<<<<<<
 *     'i1': int8,
 *     'int8': int8,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_bool); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_bool_2, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1351
 *     'null': null,
 *     'bool': bool_,
 *     'i1': int8,             # <<<<<<<<<<<<<<
 *     'int8': int8,
 *     'i2': int16,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_int8); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 1351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_i1, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1352
 *     'bool': 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(3, 1352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_int8, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1353
 *     '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(3, 1353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_i2, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1354
 *     '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(3, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_int16, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1355
 *     '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(3, 1355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_i4, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1356
 *     '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(3, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_int32, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1357
 *     '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(3, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_i8, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1358
 *     '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(3, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_int64, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1359
 *     '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(3, 1359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_u1, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1360
 *     '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(3, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_uint8, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1361
 *     '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(3, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_u2, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1362
 *     '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(3, 1362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_uint16, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1363
 *     '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(3, 1363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_u4, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1364
 *     '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(3, 1364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_uint32, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1365
 *     '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(3, 1365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_u8, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1366
 *     '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(3, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_uint64, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1367
 *     '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(3, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_f2, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1368
 *     '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(3, 1368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_halffloat, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1369
 *     '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(3, 1369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_float16, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1370
 *     '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(3, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_f4, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1371
 *     '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(3, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_float, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1372
 *     '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(3, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_float32, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1373
 *     '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(3, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_f8, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1374
 *     '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(3, 1374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_double, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1375
 *     '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(3, 1375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_float64, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1376
 *     '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(3, 1376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_string, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1377
 *     '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(3, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_str_2, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1378
 *     'string': string,
 *     'str': string,
 *     'utf8': string,             # <<<<<<<<<<<<<<
 *     'binary': binary,
 *     'date32': date32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_string); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 1378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_utf8, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1379
 *     'str': string,
 *     'utf8': string,
 *     'binary': binary,             # <<<<<<<<<<<<<<
 *     'date32': date32,
 *     'date64': date64,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_binary); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 1379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_binary, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1380
 *     'utf8': string,
 *     'binary': binary,
 *     'date32': date32,             # <<<<<<<<<<<<<<
 *     'date64': date64,
 *     'date32[day]': date32,
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_date32); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_date32, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1381
 *     'binary': 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(3, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_n_s_date64, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1382
 *     '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(3, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_s_date32_day, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1383
 *     '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(3, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_s_date64_ms, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1384
 *     '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(3, 1384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__235, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 1384, __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_s_time32_s, __pyx_t_18) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":1385
 *     '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(3, 1385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__236, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 1385, __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_s_time32_ms, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1386
 *     '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(3, 1386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__237, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 1386, __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_s_time64_us, __pyx_t_18) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":1387
 *     '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(3, 1387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__238, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 1387, __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_s_time64_ns, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1388
 *     '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(3, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__235, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 1388, __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_s_timestamp_s, __pyx_t_18) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":1389
 *     '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(3, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__236, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 1389, __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_s_timestamp_ms, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/types.pxi":1390
 *     'timestamp[s]': timestamp('s'),
 *     'timestamp[ms]': timestamp('ms'),
 *     'timestamp[us]': timestamp('us'),             # <<<<<<<<<<<<<<
 *     'timestamp[ns]': timestamp('ns'),
 * }
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_timestamp); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 1390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__237, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(3, 1390, __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_s_timestamp_us, __pyx_t_18) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/types.pxi":1391
 *     '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(3, 1391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_tuple__238, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 1391, __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_s_timestamp_ns, __pyx_t_19) < 0) __PYX_ERR(3, 1349, __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":1395
 * 
 * 
 * def type_for_alias(name):             # <<<<<<<<<<<<<<
 *     """
 *     Return DataType given a string alias if one exists
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_73type_for_alias, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1395, __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(3, 1395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1414
 * 
 * 
 * def schema(fields, dict metadata=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct pyarrow.Schema from collection of fields
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_75schema, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_schema, __pyx_t_20) < 0) __PYX_ERR(3, 1414, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1465
 * 
 * 
 * def from_numpy_dtype(object dtype):             # <<<<<<<<<<<<<<
 *     """
 *     Convert NumPy dtype to pyarrow.DataType
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_77from_numpy_dtype, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1465, __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(3, 1465, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1477
 * 
 * 
 * def is_boolean_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyBool(obj)
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_79is_boolean_value, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1477, __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(3, 1477, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1481
 * 
 * 
 * def is_integer_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyInt(obj)
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_81is_integer_value, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1481, __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(3, 1481, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/types.pxi":1485
 * 
 * 
 * def is_float_value(object obj):             # <<<<<<<<<<<<<<
 *     return IsPyFloat(obj)
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_83is_float_value, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(3, 1485, __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(3, 1485, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/scalar.pxi":19
 * 
 * 
 * _NULL = NA = None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_2, Py_None) < 0) __PYX_ERR(1, 19, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NA, Py_None) < 0) __PYX_ERR(1, 19, __pyx_L1_error)

  /* "pyarrow/scalar.pxi":40
 * 
 * 
 * _NULL = NA = NullType()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_20 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_NullType)); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NULL_2, __pyx_t_20) < 0) __PYX_ERR(1, 40, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NA, __pyx_t_20) < 0) __PYX_ERR(1, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/scalar.pxi":198
 * cdef dict DATETIME_CONVERSION_FUNCTIONS
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pandas as pd
 * except ImportError:
 */
  {
    __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/scalar.pxi":199
 * 
 * try:
 *     import pandas as pd             # <<<<<<<<<<<<<<
 * except ImportError:
 *     DATETIME_CONVERSION_FUNCTIONS = {
 */
      __pyx_t_20 = __Pyx_Import(__pyx_n_s_pandas, 0, -1); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 199, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_20);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_pd, __pyx_t_20) < 0) __PYX_ERR(1, 199, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

      /* "pyarrow/scalar.pxi":198
 * cdef dict DATETIME_CONVERSION_FUNCTIONS
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pandas as pd
 * except ImportError:
 */
    }

    /* "pyarrow/scalar.pxi":214
 * else:
 *     DATETIME_CONVERSION_FUNCTIONS = {
 *         TimeUnit_SECOND: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *             x * 1000000000, tz=tzinfo, unit='ns',
 *         ),
 */
    /*else:*/ {
      __pyx_t_20 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_20)) __PYX_ERR(1, 214, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::SECOND); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 214, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_18 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_159lambda3, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 214, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_18);
      if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, __pyx_t_18) < 0) __PYX_ERR(1, 214, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

      /* "pyarrow/scalar.pxi":217
 *             x * 1000000000, tz=tzinfo, unit='ns',
 *         ),
 *         TimeUnit_MILLI: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *             x * 1000000, tz=tzinfo, unit='ns',
 *         ),
 */
      __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::MILLI); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 217, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_18);
      __pyx_t_19 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_160lambda4, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 217, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_19);
      if (PyDict_SetItem(__pyx_t_20, __pyx_t_18, __pyx_t_19) < 0) __PYX_ERR(1, 214, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

      /* "pyarrow/scalar.pxi":220
 *             x * 1000000, tz=tzinfo, unit='ns',
 *         ),
 *         TimeUnit_MICRO: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *             x * 1000, tz=tzinfo, unit='ns',
 *         ),
 */
      __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::MICRO); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 220, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_18 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_161lambda5, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 220, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_18);
      if (PyDict_SetItem(__pyx_t_20, __pyx_t_19, __pyx_t_18) < 0) __PYX_ERR(1, 214, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

      /* "pyarrow/scalar.pxi":223
 *             x * 1000, tz=tzinfo, unit='ns',
 *         ),
 *         TimeUnit_NANO: lambda x, tzinfo: pd.Timestamp(             # <<<<<<<<<<<<<<
 *             x, tz=tzinfo, unit='ns',
 *         )
 */
      __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::NANO); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 223, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_18);
      __pyx_t_19 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_162lambda6, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 223, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_19);
      if (PyDict_SetItem(__pyx_t_20, __pyx_t_18, __pyx_t_19) < 0) __PYX_ERR(1, 214, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib_DATETIME_CONVERSION_FUNCTIONS);
      __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib_DATETIME_CONVERSION_FUNCTIONS, ((PyObject*)__pyx_t_20));
      __Pyx_GIVEREF(__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;
    __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_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 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;
    __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_20); __pyx_t_20 = 0;

    /* "pyarrow/scalar.pxi":200
 * try:
 *     import pandas as pd
 * except ImportError:             # <<<<<<<<<<<<<<
 *     DATETIME_CONVERSION_FUNCTIONS = {
 *         TimeUnit_SECOND: lambda x, tzinfo: (
 */
    __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_20, &__pyx_t_19, &__pyx_t_18) < 0) __PYX_ERR(1, 200, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_GOTREF(__pyx_t_18);

      /* "pyarrow/scalar.pxi":202
 * except ImportError:
 *     DATETIME_CONVERSION_FUNCTIONS = {
 *         TimeUnit_SECOND: lambda x, tzinfo: (             # <<<<<<<<<<<<<<
 *             datetime.datetime.utcfromtimestamp(x).replace(tzinfo=tzinfo)
 *         ),
 */
      __pyx_t_17 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(1, 202, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_17);
      __pyx_t_16 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::SECOND); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 202, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_156lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 202, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_15);
      if (PyDict_SetItem(__pyx_t_17, __pyx_t_16, __pyx_t_15) < 0) __PYX_ERR(1, 202, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

      /* "pyarrow/scalar.pxi":205
 *             datetime.datetime.utcfromtimestamp(x).replace(tzinfo=tzinfo)
 *         ),
 *         TimeUnit_MILLI: lambda x, tzinfo: (             # <<<<<<<<<<<<<<
 *             datetime.datetime.utcfromtimestamp(x / 1e3).replace(tzinfo=tzinfo)
 *         ),
 */
      __pyx_t_15 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::MILLI); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 205, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_16 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_157lambda1, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 205, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_16);
      if (PyDict_SetItem(__pyx_t_17, __pyx_t_15, __pyx_t_16) < 0) __PYX_ERR(1, 202, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

      /* "pyarrow/scalar.pxi":208
 *             datetime.datetime.utcfromtimestamp(x / 1e3).replace(tzinfo=tzinfo)
 *         ),
 *         TimeUnit_MICRO: lambda x, tzinfo: (             # <<<<<<<<<<<<<<
 *             datetime.datetime.utcfromtimestamp(x / 1e6).replace(tzinfo=tzinfo)
 *         ),
 */
      __pyx_t_16 = __Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type( arrow::TimeUnit::MICRO); if (unlikely(!__pyx_t_16)) __PYX_ERR(1, 208, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_15 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_158lambda2, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_pyarrow_lib, __pyx_d, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(1, 208, __pyx_L4_except_error)
      __Pyx_GOTREF(__pyx_t_15);
      if (PyDict_SetItem(__pyx_t_17, __pyx_t_16, __pyx_t_15) < 0) __PYX_ERR(1, 202, __pyx_L4_except_error)
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XGOTREF(__pyx_v_7pyarrow_3lib_DATETIME_CONVERSION_FUNCTIONS);
      __Pyx_DECREF_SET(__pyx_v_7pyarrow_3lib_DATETIME_CONVERSION_FUNCTIONS, ((PyObject*)__pyx_t_17));
      __Pyx_GIVEREF(__pyx_t_17);
      __pyx_t_17 = 0;
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      goto __pyx_L3_exception_handled;
    }
    goto __pyx_L4_except_error;
    __pyx_L4_except_error:;

    /* "pyarrow/scalar.pxi":198
 * cdef dict DATETIME_CONVERSION_FUNCTIONS
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pandas as pd
 * except ImportError:
 */
    __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/scalar.pxi":429
 * 
 * cdef dict _scalar_classes = {
 *     _Type_BOOL: BooleanValue,             # <<<<<<<<<<<<<<
 *     _Type_UINT8: UInt8Value,
 *     _Type_UINT16: UInt16Value,
 */
  __pyx_t_18 = __Pyx_PyDict_NewPresized(25); if (unlikely(!__pyx_t_18)) __PYX_ERR(1, 429, __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(1, 429, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":430
 * cdef dict _scalar_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(1, 430, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":431
 *     _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(1, 431, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":432
 *     _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(1, 432, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":433
 *     _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(1, 433, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":434
 *     _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(1, 434, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":435
 *     _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(1, 435, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":436
 *     _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(1, 436, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":437
 *     _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(1, 437, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":438
 *     _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(1, 438, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":439
 *     _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(1, 439, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":440
 *     _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(1, 440, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":441
 *     _Type_DATE64: Date64Value,
 *     _Type_TIME32: Time32Value,
 *     _Type_TIME64: Time64Value,             # <<<<<<<<<<<<<<
 *     _Type_TIMESTAMP: TimestampValue,
 *     _Type_HALF_FLOAT: HalfFloatValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME64); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 441, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":442
 *     _Type_TIME32: Time32Value,
 *     _Type_TIME64: Time64Value,
 *     _Type_TIMESTAMP: TimestampValue,             # <<<<<<<<<<<<<<
 *     _Type_HALF_FLOAT: HalfFloatValue,
 *     _Type_FLOAT: FloatValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIMESTAMP); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 442, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":443
 *     _Type_TIME64: Time64Value,
 *     _Type_TIMESTAMP: TimestampValue,
 *     _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(1, 443, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":444
 *     _Type_TIMESTAMP: TimestampValue,
 *     _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(1, 444, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":445
 *     _Type_HALF_FLOAT: HalfFloatValue,
 *     _Type_FLOAT: FloatValue,
 *     _Type_DOUBLE: DoubleValue,             # <<<<<<<<<<<<<<
 *     _Type_LIST: ListValue,
 *     _Type_UNION: UnionValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 445, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":446
 *     _Type_FLOAT: FloatValue,
 *     _Type_DOUBLE: DoubleValue,
 *     _Type_LIST: ListValue,             # <<<<<<<<<<<<<<
 *     _Type_UNION: UnionValue,
 *     _Type_BINARY: BinaryValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LIST); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 446, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":447
 *     _Type_DOUBLE: DoubleValue,
 *     _Type_LIST: ListValue,
 *     _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(1, 447, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":448
 *     _Type_LIST: ListValue,
 *     _Type_UNION: UnionValue,
 *     _Type_BINARY: BinaryValue,             # <<<<<<<<<<<<<<
 *     _Type_STRING: StringValue,
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BINARY); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 448, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":449
 *     _Type_UNION: UnionValue,
 *     _Type_BINARY: BinaryValue,
 *     _Type_STRING: StringValue,             # <<<<<<<<<<<<<<
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryValue,
 *     _Type_DECIMAL: DecimalValue,
 */
  __pyx_t_19 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRING); if (unlikely(!__pyx_t_19)) __PYX_ERR(1, 449, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":450
 *     _Type_BINARY: BinaryValue,
 *     _Type_STRING: StringValue,
 *     _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(1, 450, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":451
 *     _Type_STRING: StringValue,
 *     _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(1, 451, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":452
 *     _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(1, 452, __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(1, 429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/scalar.pxi":453
 *     _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(1, 453, __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(1, 429, __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":87
 * 
 * 
 * def array(object obj, type=None, mask=None, size=None, bint from_pandas=False,             # <<<<<<<<<<<<<<
 *           bint safe=True, MemoryPool memory_pool=None):
 *     """
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_85array, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 87, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_array, __pyx_t_18) < 0) __PYX_ERR(2, 87, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":176
 * 
 * 
 * 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_87asarray, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_asarray, __pyx_t_18) < 0) __PYX_ERR(2, 176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":199
 * 
 * 
 * def _normalize_slice(object arrow_obj, slice key):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Py_ssize_t start, stop, step
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_89_normalize_slice, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_normalize_slice, __pyx_t_18) < 0) __PYX_ERR(2, 199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":245
 *         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(2, 245, __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":332
 * 
 * 
 * def _restore_array(data):             # <<<<<<<<<<<<<<
 *     """
 *     Reconstruct an Array from pickled ArrayData.
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_91_restore_array, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_restore_array, __pyx_t_18) < 0) __PYX_ERR(2, 332, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":442
 * 
 *     @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_13from_pandas, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 442, __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(2, 442, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Array);

  /* "pyarrow/array.pxi":441
 *         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(2, 442, __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(2, 441, __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(2, 442, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Array);

  /* "pyarrow/array.pxi":482
 * 
 *     @staticmethod
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0):             # <<<<<<<<<<<<<<
 *         """
 *         Construct an Array from a sequence of buffers.  The concrete type
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5Array_17from_buffers, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 482, __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(2, 482, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Array);

  /* "pyarrow/array.pxi":481
 *             (_reduce_array_data(self.sp_array.get().data().get()),)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_buffers(DataType type, length, buffers, null_count=-1, offset=0):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_Array, __pyx_n_s_from_buffers); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 482, __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(2, 481, __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(2, 482, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Array);

  /* "pyarrow/array.pxi":731
 * 
 *     @staticmethod
 *     def from_numpy(obj):             # <<<<<<<<<<<<<<
 *         cdef shared_ptr[CTensor] ctensor
 *         with nogil:
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_6Tensor_5from_numpy, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Tensor->tp_dict, __pyx_n_s_from_numpy, __pyx_t_18) < 0) __PYX_ERR(2, 731, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Tensor);

  /* "pyarrow/array.pxi":730
 * strides: {0.strides}""".format(self)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_numpy(obj):
 *         cdef shared_ptr[CTensor] ctensor
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_Tensor, __pyx_n_s_from_numpy); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 731, __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(2, 730, __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_Tensor->tp_dict, __pyx_n_s_from_numpy, __pyx_t_19) < 0) __PYX_ERR(2, 731, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Tensor);

  /* "pyarrow/array.pxi":914
 * 
 *     @staticmethod
 *     def from_arrays(offsets, values, MemoryPool pool=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct ListArray from arrays of int32 offsets and values
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_9ListArray_1from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_ListArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(2, 914, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_ListArray);

  /* "pyarrow/array.pxi":913
 * cdef class ListArray(Array):
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(offsets, values, MemoryPool pool=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_ListArray, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 914, __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(2, 913, __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_ListArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(2, 914, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_ListArray);

  /* "pyarrow/array.pxi":944
 * 
 *     @staticmethod
 *     def from_dense(Array types, Array value_offsets, list children):             # <<<<<<<<<<<<<<
 *         """
 *         Construct dense UnionArray from arrays of int8 types, int32 offsets and
 */
  __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(2, 944, __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(2, 944, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_UnionArray);

  /* "pyarrow/array.pxi":943
 * cdef class UnionArray(Array):
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_dense(Array types, Array value_offsets, list children):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray, __pyx_n_s_from_dense); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 944, __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(2, 943, __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(2, 944, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_UnionArray);

  /* "pyarrow/array.pxi":970
 * 
 *     @staticmethod
 *     def from_sparse(Array types, list children):             # <<<<<<<<<<<<<<
 *         """
 *         Construct sparse UnionArray from arrays of int8 types and children
 */
  __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(2, 970, __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(2, 970, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_UnionArray);

  /* "pyarrow/array.pxi":969
 *         return pyarrow_wrap_array(out)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_sparse(Array types, list children):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_UnionArray, __pyx_n_s_from_sparse); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 970, __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(2, 969, __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(2, 970, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_UnionArray);

  /* "pyarrow/array.pxi":997
 * 
 *     @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(2, 997, __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(2, 997, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_StringArray);

  /* "pyarrow/array.pxi":996
 * cdef class StringArray(Array):
 * 
 *     @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(2, 997, __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(2, 996, __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(2, 997, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_StringArray);

  /* "pyarrow/array.pxi":1060
 * 
 *     @staticmethod
 *     def from_arrays(indices, dictionary, mask=None, bint ordered=False,             # <<<<<<<<<<<<<<
 *                     bint from_pandas=False, bint safe=True,
 *                     MemoryPool memory_pool=None):
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_15DictionaryArray_3from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 1060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_DictionaryArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(2, 1060, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_DictionaryArray);

  /* "pyarrow/array.pxi":1059
 *         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_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_DictionaryArray, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 1060, __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(2, 1059, __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_DictionaryArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(2, 1060, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_DictionaryArray);

  /* "pyarrow/array.pxi":1174
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct StructArray from collection of arrays representing each field
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11StructArray_5from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_StructArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(2, 1174, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_StructArray);

  /* "pyarrow/array.pxi":1173
 *         return [pyarrow_wrap_array(arr) for arr in arrays]
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(arrays, names=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_StructArray, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 1174, __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(2, 1173, __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_StructArray->tp_dict, __pyx_n_s_from_arrays, __pyx_t_19) < 0) __PYX_ERR(2, 1174, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_StructArray);

  /* "pyarrow/array.pxi":1228
 * 
 * cdef dict _array_classes = {
 *     _Type_NA: NullArray,             # <<<<<<<<<<<<<<
 *     _Type_BOOL: BooleanArray,
 *     _Type_UINT8: UInt8Array,
 */
  __pyx_t_19 = __Pyx_PyDict_NewPresized(26); if (unlikely(!__pyx_t_19)) __PYX_ERR(2, 1228, __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(2, 1228, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1229
 * 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(2, 1229, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1230
 *     _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(2, 1230, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1231
 *     _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(2, 1231, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1232
 *     _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(2, 1232, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1233
 *     _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(2, 1233, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1234
 *     _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(2, 1234, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1235
 *     _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(2, 1235, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1236
 *     _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(2, 1236, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1237
 *     _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(2, 1237, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1238
 *     _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(2, 1238, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1239
 *     _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(2, 1239, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1240
 *     _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(2, 1240, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1241
 *     _Type_DATE64: Date64Array,
 *     _Type_TIMESTAMP: TimestampArray,
 *     _Type_TIME32: Time32Array,             # <<<<<<<<<<<<<<
 *     _Type_TIME64: Time64Array,
 *     _Type_HALF_FLOAT: HalfFloatArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME32); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 1241, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1242
 *     _Type_TIMESTAMP: TimestampArray,
 *     _Type_TIME32: Time32Array,
 *     _Type_TIME64: Time64Array,             # <<<<<<<<<<<<<<
 *     _Type_HALF_FLOAT: HalfFloatArray,
 *     _Type_FLOAT: FloatArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::TIME64); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 1242, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1243
 *     _Type_TIME32: Time32Array,
 *     _Type_TIME64: Time64Array,
 *     _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(2, 1243, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1244
 *     _Type_TIME64: Time64Array,
 *     _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(2, 1244, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1245
 *     _Type_HALF_FLOAT: HalfFloatArray,
 *     _Type_FLOAT: FloatArray,
 *     _Type_DOUBLE: DoubleArray,             # <<<<<<<<<<<<<<
 *     _Type_LIST: ListArray,
 *     _Type_UNION: UnionArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::DOUBLE); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 1245, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1246
 *     _Type_FLOAT: FloatArray,
 *     _Type_DOUBLE: DoubleArray,
 *     _Type_LIST: ListArray,             # <<<<<<<<<<<<<<
 *     _Type_UNION: UnionArray,
 *     _Type_BINARY: BinaryArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::LIST); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 1246, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1247
 *     _Type_DOUBLE: DoubleArray,
 *     _Type_LIST: ListArray,
 *     _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(2, 1247, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1248
 *     _Type_LIST: ListArray,
 *     _Type_UNION: UnionArray,
 *     _Type_BINARY: BinaryArray,             # <<<<<<<<<<<<<<
 *     _Type_STRING: StringArray,
 *     _Type_DICTIONARY: DictionaryArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::BINARY); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 1248, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1249
 *     _Type_UNION: UnionArray,
 *     _Type_BINARY: BinaryArray,
 *     _Type_STRING: StringArray,             # <<<<<<<<<<<<<<
 *     _Type_DICTIONARY: DictionaryArray,
 *     _Type_FIXED_SIZE_BINARY: FixedSizeBinaryArray,
 */
  __pyx_t_18 = __Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type( arrow::Type::STRING); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 1249, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1250
 *     _Type_BINARY: BinaryArray,
 *     _Type_STRING: StringArray,
 *     _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(2, 1250, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1251
 *     _Type_STRING: StringArray,
 *     _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(2, 1251, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1252
 *     _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::DECIMAL); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 1252, __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(2, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/array.pxi":1253
 *     _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::STRUCT); if (unlikely(!__pyx_t_18)) __PYX_ERR(2, 1253, __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(2, 1228, __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/builder.pxi":18
 * # under the License.
 * 
 * import six             # <<<<<<<<<<<<<<
 * 
 * from pyarrow.compat import tobytes
 */
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_six, 0, -1); if (unlikely(!__pyx_t_19)) __PYX_ERR(9, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_six, __pyx_t_19) < 0) __PYX_ERR(9, 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(9, 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, -1); if (unlikely(!__pyx_t_18)) __PYX_ERR(9, 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(9, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tobytes, __pyx_t_19) < 0) __PYX_ERR(9, 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 json             # <<<<<<<<<<<<<<
 * 
 * from collections import OrderedDict
 */
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_json, 0, -1); if (unlikely(!__pyx_t_18)) __PYX_ERR(10, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_json, __pyx_t_18) < 0) __PYX_ERR(10, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/table.pxi":20
 * import json
 * 
 * from collections import OrderedDict             # <<<<<<<<<<<<<<
 * 
 * try:
 */
  __pyx_t_18 = PyList_New(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(10, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_INCREF(__pyx_n_s_OrderedDict);
  __Pyx_GIVEREF(__pyx_n_s_OrderedDict);
  PyList_SET_ITEM(__pyx_t_18, 0, __pyx_n_s_OrderedDict);
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_18, -1); if (unlikely(!__pyx_t_19)) __PYX_ERR(10, 20, __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_OrderedDict); if (unlikely(!__pyx_t_18)) __PYX_ERR(10, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_OrderedDict, __pyx_t_18) < 0) __PYX_ERR(10, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/table.pxi":22
 * from collections import OrderedDict
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pandas as pd
 * except ImportError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_23, &__pyx_t_22, &__pyx_t_21);
    __Pyx_XGOTREF(__pyx_t_23);
    __Pyx_XGOTREF(__pyx_t_22);
    __Pyx_XGOTREF(__pyx_t_21);
    /*try:*/ {

      /* "pyarrow/table.pxi":23
 * 
 * try:
 *     import pandas as pd             # <<<<<<<<<<<<<<
 * except ImportError:
 *     # The pure-Python based API works without a pandas installation
 */
      __pyx_t_19 = __Pyx_Import(__pyx_n_s_pandas, 0, -1); if (unlikely(!__pyx_t_19)) __PYX_ERR(10, 23, __pyx_L10_error)
      __Pyx_GOTREF(__pyx_t_19);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_pd, __pyx_t_19) < 0) __PYX_ERR(10, 23, __pyx_L10_error)
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

      /* "pyarrow/table.pxi":22
 * from collections import OrderedDict
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pandas as pd
 * except ImportError:
 */
    }

    /* "pyarrow/table.pxi":28
 *     pass
 * else:
 *     import pyarrow.pandas_compat as pdcompat             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else:*/ {
      __pyx_t_19 = PyList_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(10, 28, __pyx_L12_except_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_INCREF(__pyx_n_s__75);
      __Pyx_GIVEREF(__pyx_n_s__75);
      PyList_SET_ITEM(__pyx_t_19, 0, __pyx_n_s__75);
      __pyx_t_18 = __Pyx_Import(__pyx_n_s_pyarrow_pandas_compat, __pyx_t_19, -1); if (unlikely(!__pyx_t_18)) __PYX_ERR(10, 28, __pyx_L12_except_error)
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_pdcompat, __pyx_t_18) < 0) __PYX_ERR(10, 28, __pyx_L12_except_error)
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    }
    __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0;
    __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
    __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
    goto __pyx_L15_try_end;
    __pyx_L10_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 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;
    __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_16); __pyx_t_16 = 0;
    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
    __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;

    /* "pyarrow/table.pxi":24
 * try:
 *     import pandas as pd
 * except ImportError:             # <<<<<<<<<<<<<<
 *     # The pure-Python based API works without a pandas installation
 *     pass
 */
    __pyx_t_3 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_3) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L11_exception_handled;
    }
    goto __pyx_L12_except_error;
    __pyx_L12_except_error:;

    /* "pyarrow/table.pxi":22
 * from collections import OrderedDict
 * 
 * try:             # <<<<<<<<<<<<<<
 *     import pandas as pd
 * except ImportError:
 */
    __Pyx_XGIVEREF(__pyx_t_23);
    __Pyx_XGIVEREF(__pyx_t_22);
    __Pyx_XGIVEREF(__pyx_t_21);
    __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_22, __pyx_t_21);
    goto __pyx_L1_error;
    __pyx_L11_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_23);
    __Pyx_XGIVEREF(__pyx_t_22);
    __Pyx_XGIVEREF(__pyx_t_21);
    __Pyx_ExceptionReset(__pyx_t_23, __pyx_t_22, __pyx_t_21);
    __pyx_L15_try_end:;
  }

  /* "pyarrow/table.pxi":297
 * 
 * 
 * def chunked_array(arrays, type=None):             # <<<<<<<<<<<<<<
 *     """
 *     Construct chunked array from list of array-like objects
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_93chunked_array, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(10, 297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_chunked_array, __pyx_t_18) < 0) __PYX_ERR(10, 297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/table.pxi":337
 * 
 * 
 * def column(object field_or_name, arr):             # <<<<<<<<<<<<<<
 *     """
 *     Create Column object from field/string and array-like data
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_95column, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(10, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_column, __pyx_t_18) < 0) __PYX_ERR(10, 337, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/table.pxi":426
 * 
 *     @staticmethod
 *     def from_array(*args):             # <<<<<<<<<<<<<<
 *         return column(*args)
 * 
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_6Column_13from_array, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(10, 426, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Column->tp_dict, __pyx_n_s_from_array, __pyx_t_18) < 0) __PYX_ERR(10, 426, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Column);

  /* "pyarrow/table.pxi":425
 *         return self.data[key]
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_array(*args):
 *         return column(*args)
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_Column, __pyx_n_s_from_array); if (unlikely(!__pyx_t_18)) __PYX_ERR(10, 426, __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(10, 425, __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_Column->tp_dict, __pyx_n_s_from_array, __pyx_t_19) < 0) __PYX_ERR(10, 426, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Column);

  /* "pyarrow/table.pxi":926
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, bint preserve_index=True,             # <<<<<<<<<<<<<<
 *                     nthreads=None, columns=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch, __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_19)) __PYX_ERR(10, 926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);

  /* "pyarrow/table.pxi":925
 *         )
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(cls, df, Schema schema=None, bint preserve_index=True,
 *                     nthreads=None, columns=None):
 */
  __pyx_t_18 = __Pyx_Method_ClassMethod(__pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(10, 925, __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_pandas, __pyx_t_18) < 0) __PYX_ERR(10, 926, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_RecordBatch);

  /* "pyarrow/table.pxi":956
 * 
 *     @staticmethod
 *     def from_arrays(list arrays, names, dict metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a RecordBatch from multiple pyarrow.Arrays
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_11RecordBatch_27from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(10, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch->tp_dict, __pyx_n_s_from_arrays, __pyx_t_18) < 0) __PYX_ERR(10, 956, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_RecordBatch);

  /* "pyarrow/table.pxi":955
 *         return cls.from_arrays(arrays, names, metadata)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(list arrays, names, dict metadata=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_RecordBatch, __pyx_n_s_from_arrays); if (unlikely(!__pyx_t_18)) __PYX_ERR(10, 956, __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(10, 955, __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_arrays, __pyx_t_19) < 0) __PYX_ERR(10, 956, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_RecordBatch);

  /* "pyarrow/table.pxi":1000
 * 
 * 
 * def _reconstruct_record_batch(columns, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct RecordBatch from pickled components.
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_97_reconstruct_record_batch, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(10, 1000, __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(10, 1000, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/table.pxi":1007
 * 
 * 
 * def table_to_blocks(PandasOptions options, Table table,             # <<<<<<<<<<<<<<
 *                     MemoryPool memory_pool, categories):
 *     cdef:
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_99table_to_blocks, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(10, 1007, __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(10, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/table.pxi":1166
 * 
 *     @classmethod
 *     def from_pandas(cls, df, Schema schema=None, bint preserve_index=True,             # <<<<<<<<<<<<<<
 *                     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(10, 1166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);

  /* "pyarrow/table.pxi":1165
 *         return Table.from_arrays(newcols, schema=target_schema)
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def from_pandas(cls, df, Schema schema=None, bint preserve_index=True,
 *                     nthreads=None, columns=None, bint safe=True):
 */
  __pyx_t_18 = __Pyx_Method_ClassMethod(__pyx_t_19); if (unlikely(!__pyx_t_18)) __PYX_ERR(10, 1165, __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(10, 1166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1228
 * 
 *     @staticmethod
 *     def from_arrays(arrays, names=None, schema=None, dict metadata=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from Arrow arrays or columns
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5Table_21from_arrays, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(10, 1228, __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(10, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1227
 *         return cls.from_arrays(arrays, names=names, metadata=metadata)
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_arrays(arrays, names=None, schema=None, dict 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(10, 1228, __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(10, 1227, __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(10, 1228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1295
 * 
 *     @staticmethod
 *     def from_batches(batches, Schema schema=None):             # <<<<<<<<<<<<<<
 *         """
 *         Construct a Table from a sequence or iterator of Arrow RecordBatches
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_5Table_23from_batches, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(10, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_Table->tp_dict, __pyx_n_s_from_batches, __pyx_t_19) < 0) __PYX_ERR(10, 1295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1294
 *         return pyarrow_wrap_table(CTable.Make(c_schema, columns))
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_batches(batches, Schema schema=None):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_Table, __pyx_n_s_from_batches); if (unlikely(!__pyx_t_19)) __PYX_ERR(10, 1295, __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(10, 1294, __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_batches, __pyx_t_18) < 0) __PYX_ERR(10, 1295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_Table);

  /* "pyarrow/table.pxi":1619
 * 
 * 
 * def _reconstruct_table(arrays, schema):             # <<<<<<<<<<<<<<
 *     """
 *     Internal: reconstruct pa.Table from pickled components.
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_101_reconstruct_table, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(10, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reconstruct_table, __pyx_t_18) < 0) __PYX_ERR(10, 1619, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/table.pxi":1626
 * 
 * 
 * def concat_tables(tables):             # <<<<<<<<<<<<<<
 *     """
 *     Perform zero-copy concatenation of pyarrow.Table objects. Raises exception
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_103concat_tables, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(10, 1626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_concat_tables, __pyx_t_18) < 0) __PYX_ERR(10, 1626, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":23
 * from libc.stdlib cimport malloc, free
 * 
 * import re             # <<<<<<<<<<<<<<
 * import six
 * import sys
 */
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_re, 0, -1); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_18) < 0) __PYX_ERR(4, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":24
 * 
 * import re
 * import six             # <<<<<<<<<<<<<<
 * import sys
 * import threading
 */
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_six, 0, -1); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_six, __pyx_t_18) < 0) __PYX_ERR(4, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":25
 * import re
 * import six
 * import sys             # <<<<<<<<<<<<<<
 * import threading
 * import time
 */
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_18) < 0) __PYX_ERR(4, 25, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":26
 * import six
 * import sys
 * import threading             # <<<<<<<<<<<<<<
 * import time
 * import warnings
 */
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_threading, 0, -1); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_18) < 0) __PYX_ERR(4, 26, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":27
 * import sys
 * import threading
 * import time             # <<<<<<<<<<<<<<
 * import warnings
 * from io import BufferedIOBase, UnsupportedOperation
 */
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_18) < 0) __PYX_ERR(4, 27, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":28
 * import threading
 * import time
 * import warnings             # <<<<<<<<<<<<<<
 * from io import BufferedIOBase, UnsupportedOperation
 * 
 */
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_warnings, 0, -1); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 28, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_18) < 0) __PYX_ERR(4, 28, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":29
 * import time
 * import warnings
 * from io import BufferedIOBase, UnsupportedOperation             # <<<<<<<<<<<<<<
 * 
 * from pyarrow.util import _stringify_path
 */
  __pyx_t_18 = PyList_New(2); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_INCREF(__pyx_n_s_BufferedIOBase);
  __Pyx_GIVEREF(__pyx_n_s_BufferedIOBase);
  PyList_SET_ITEM(__pyx_t_18, 0, __pyx_n_s_BufferedIOBase);
  __Pyx_INCREF(__pyx_n_s_UnsupportedOperation);
  __Pyx_GIVEREF(__pyx_n_s_UnsupportedOperation);
  PyList_SET_ITEM(__pyx_t_18, 1, __pyx_n_s_UnsupportedOperation);
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_io, __pyx_t_18, -1); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 29, __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_BufferedIOBase); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BufferedIOBase, __pyx_t_18) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_18 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_UnsupportedOperation); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnsupportedOperation, __pyx_t_18) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":31
 * from io import BufferedIOBase, UnsupportedOperation
 * 
 * from pyarrow.util import _stringify_path             # <<<<<<<<<<<<<<
 * from pyarrow.compat import builtin_pickle, frombytes, tobytes, encode_file_path
 * 
 */
  __pyx_t_19 = PyList_New(1); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_INCREF(__pyx_n_s_stringify_path);
  __Pyx_GIVEREF(__pyx_n_s_stringify_path);
  PyList_SET_ITEM(__pyx_t_19, 0, __pyx_n_s_stringify_path);
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_pyarrow_util, __pyx_t_19, -1); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 31, __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_stringify_path); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_stringify_path, __pyx_t_19) < 0) __PYX_ERR(4, 31, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":32
 * 
 * from pyarrow.util import _stringify_path
 * from pyarrow.compat import builtin_pickle, frombytes, tobytes, encode_file_path             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_18 = PyList_New(4); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_INCREF(__pyx_n_s_builtin_pickle);
  __Pyx_GIVEREF(__pyx_n_s_builtin_pickle);
  PyList_SET_ITEM(__pyx_t_18, 0, __pyx_n_s_builtin_pickle);
  __Pyx_INCREF(__pyx_n_s_frombytes);
  __Pyx_GIVEREF(__pyx_n_s_frombytes);
  PyList_SET_ITEM(__pyx_t_18, 1, __pyx_n_s_frombytes);
  __Pyx_INCREF(__pyx_n_s_tobytes);
  __Pyx_GIVEREF(__pyx_n_s_tobytes);
  PyList_SET_ITEM(__pyx_t_18, 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_18, 3, __pyx_n_s_encode_file_path);
  __pyx_t_19 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_18, -1); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 32, __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_builtin_pickle); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_builtin_pickle, __pyx_t_18) < 0) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_18 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_frombytes); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_frombytes, __pyx_t_18) < 0) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_18 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_tobytes); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tobytes, __pyx_t_18) < 0) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_18 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_encode_file_path); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_encode_file_path, __pyx_t_18) < 0) __PYX_ERR(4, 32, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":36
 * 
 * # 64K
 * DEFAULT_BUFFER_SIZE = 2 ** 16             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DEFAULT_BUFFER_SIZE, __pyx_int_65536) < 0) __PYX_ERR(4, 36, __pyx_L1_error)

  /* "pyarrow/io.pxi":501
 *             raise exc_info[0], exc_info[1], exc_info[2]
 * 
 * BufferedIOBase.register(NativeFile)             # <<<<<<<<<<<<<<
 * 
 * # ----------------------------------------------------------------------
 */
  __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_BufferedIOBase); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_register); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __pyx_t_19 = __Pyx_PyObject_CallOneArg(__pyx_t_18, ((PyObject *)__pyx_ptype_7pyarrow_3lib_NativeFile)); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

  /* "pyarrow/io.pxi":556
 * 
 *     @staticmethod
 *     def create(path, size):             # <<<<<<<<<<<<<<
 *         cdef:
 *             shared_ptr[CMemoryMappedFile] handle
 */
  __pyx_t_19 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_16MemoryMappedFile_1create, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_MemoryMappedFile->tp_dict, __pyx_n_s_create, __pyx_t_19) < 0) __PYX_ERR(4, 556, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MemoryMappedFile);

  /* "pyarrow/io.pxi":555
 *         object path
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def create(path, size):
 *         cdef:
 */
  __Pyx_GetNameInClass(__pyx_t_19, (PyObject *)__pyx_ptype_7pyarrow_3lib_MemoryMappedFile, __pyx_n_s_create); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 556, __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(4, 555, __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_MemoryMappedFile->tp_dict, __pyx_n_s_create, __pyx_t_18) < 0) __PYX_ERR(4, 556, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MemoryMappedFile);

  /* "pyarrow/io.pxi":620
 * 
 * 
 * def memory_map(path, mode='r'):             # <<<<<<<<<<<<<<
 *     """
 *     Open memory map at file path. Size of the memory map cannot change
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_105memory_map, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_memory_map, __pyx_t_18) < 0) __PYX_ERR(4, 620, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":638
 * 
 * 
 * def create_memory_map(path, size):             # <<<<<<<<<<<<<<
 *     """
 *     Create memory map at indicated path of the given size, return open
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_107create_memory_map, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_create_memory_map, __pyx_t_18) < 0) __PYX_ERR(4, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":905
 * 
 * 
 * def allocate_buffer(int64_t size, MemoryPool memory_pool=None,             # <<<<<<<<<<<<<<
 *                     resizable=False):
 *     """
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_109allocate_buffer, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_allocate_buffer, __pyx_t_18) < 0) __PYX_ERR(4, 905, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":997
 * 
 * 
 * def py_buffer(object obj):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer from a Python bytes object
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_111py_buffer, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 997, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_py_buffer, __pyx_t_18) < 0) __PYX_ERR(4, 997, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":1006
 * 
 * 
 * def foreign_buffer(address, size, base):             # <<<<<<<<<<<<<<
 *     """
 *     Construct an Arrow buffer with the given *address* and *size*,
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_113foreign_buffer, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_foreign_buffer, __pyx_t_18) < 0) __PYX_ERR(4, 1006, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":1021
 * 
 * 
 * def as_buffer(object o):             # <<<<<<<<<<<<<<
 *     if isinstance(o, Buffer):
 *         return o
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_115as_buffer, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_as_buffer, __pyx_t_18) < 0) __PYX_ERR(4, 1021, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":1102
 * 
 * 
 * def compress(object buf, codec='lz4', asbytes=False, memory_pool=None):             # <<<<<<<<<<<<<<
 *     """
 *     Compress pyarrow.Buffer or Python object supporting the buffer (memoryview)
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_117compress, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_compress, __pyx_t_18) < 0) __PYX_ERR(4, 1102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io.pxi":1165
 * 
 * 
 * def decompress(object buf, decompressed_size=None, codec='lz4',             # <<<<<<<<<<<<<<
 *                asbytes=False, memory_pool=None):
 *     """
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_119decompress, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(4, 1165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_decompress, __pyx_t_18) < 0) __PYX_ERR(4, 1165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io-hdfs.pxi":21
 * # HDFS IO implementation
 * 
 * _HDFS_PATH_RE = re.compile('hdfs://(.*):(\d+)(.*)')             # <<<<<<<<<<<<<<
 * 
 * try:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_re); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_compile); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_tuple__315, NULL); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_HDFS_PATH_RE, __pyx_t_18) < 0) __PYX_ERR(12, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/io-hdfs.pxi":23
 * _HDFS_PATH_RE = re.compile('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_18 = PyList_New(3); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 25, __pyx_L16_error)
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_INCREF(__pyx_n_s_Queue);
      __Pyx_GIVEREF(__pyx_n_s_Queue);
      PyList_SET_ITEM(__pyx_t_18, 0, __pyx_n_s_Queue);
      __Pyx_INCREF(__pyx_n_s_Empty);
      __Pyx_GIVEREF(__pyx_n_s_Empty);
      PyList_SET_ITEM(__pyx_t_18, 1, __pyx_n_s_Empty);
      __Pyx_INCREF(__pyx_n_s_Full);
      __Pyx_GIVEREF(__pyx_n_s_Full);
      PyList_SET_ITEM(__pyx_t_18, 2, __pyx_n_s_Full);
      __pyx_t_19 = __Pyx_Import(__pyx_n_s_queue, __pyx_t_18, -1); if (unlikely(!__pyx_t_19)) __PYX_ERR(12, 25, __pyx_L16_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_Queue); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 25, __pyx_L16_error)
      __Pyx_GOTREF(__pyx_t_18);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Queue, __pyx_t_18) < 0) __PYX_ERR(12, 25, __pyx_L16_error)
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      __pyx_t_18 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_Empty); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 25, __pyx_L16_error)
      __Pyx_GOTREF(__pyx_t_18);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueEmpty, __pyx_t_18) < 0) __PYX_ERR(12, 25, __pyx_L16_error)
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      __pyx_t_18 = __Pyx_ImportFrom(__pyx_t_19, __pyx_n_s_Full); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 25, __pyx_L16_error)
      __Pyx_GOTREF(__pyx_t_18);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueFull, __pyx_t_18) < 0) __PYX_ERR(12, 25, __pyx_L16_error)
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;

      /* "pyarrow/io-hdfs.pxi":23
 * _HDFS_PATH_RE = re.compile('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_L21_try_end;
    __pyx_L16_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 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;
    __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_16); __pyx_t_16 = 0;
    __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
    __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
    __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
    __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 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_19, &__pyx_t_18, &__pyx_t_20) < 0) __PYX_ERR(12, 26, __pyx_L18_except_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_GOTREF(__pyx_t_18);
      __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(12, 27, __pyx_L18_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_15 = __Pyx_Import(__pyx_n_s_Queue, __pyx_t_17, -1); if (unlikely(!__pyx_t_15)) __PYX_ERR(12, 27, __pyx_L18_except_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_ImportFrom(__pyx_t_15, __pyx_n_s_Queue); if (unlikely(!__pyx_t_17)) __PYX_ERR(12, 27, __pyx_L18_except_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_Queue, __pyx_t_17) < 0) __PYX_ERR(12, 27, __pyx_L18_except_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_ImportFrom(__pyx_t_15, __pyx_n_s_Empty); if (unlikely(!__pyx_t_17)) __PYX_ERR(12, 27, __pyx_L18_except_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueEmpty, __pyx_t_17) < 0) __PYX_ERR(12, 27, __pyx_L18_except_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __pyx_t_17 = __Pyx_ImportFrom(__pyx_t_15, __pyx_n_s_Full); if (unlikely(!__pyx_t_17)) __PYX_ERR(12, 27, __pyx_L18_except_error)
      __Pyx_GOTREF(__pyx_t_17);
      if (PyDict_SetItem(__pyx_d, __pyx_n_s_QueueFull, __pyx_t_17) < 0) __PYX_ERR(12, 27, __pyx_L18_except_error)
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
      goto __pyx_L17_exception_handled;
    }
    goto __pyx_L18_except_error;
    __pyx_L18_except_error:;

    /* "pyarrow/io-hdfs.pxi":23
 * _HDFS_PATH_RE = re.compile('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_L17_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_L21_try_end:;
  }

  /* "pyarrow/io-hdfs.pxi":30
 * 
 * 
 * def have_libhdfs():             # <<<<<<<<<<<<<<
 *     try:
 *         with nogil:
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_121have_libhdfs, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(12, 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(12, 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_123have_libhdfs3, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(12, 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(12, 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_125strip_hdfs_abspath, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(12, 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(12, 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(12, 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_18 = __Pyx_Method_ClassMethod(__pyx_t_20); if (unlikely(!__pyx_t_18)) __PYX_ERR(12, 108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __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_18) < 0) __PYX_ERR(12, 109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_HadoopFileSystem);

  /* "pyarrow/ipc.pxi":117
 * 
 *     @staticmethod
 *     def open_stream(source):             # <<<<<<<<<<<<<<
 *         cdef MessageReader result = MessageReader.__new__(MessageReader)
 *         cdef shared_ptr[InputStream] in_stream
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_13MessageReader_5open_stream, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_MessageReader->tp_dict, __pyx_n_s_open_stream, __pyx_t_18) < 0) __PYX_ERR(5, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MessageReader);

  /* "pyarrow/ipc.pxi":116
 *                         "instead.".format(self.__class__.__name__))
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def open_stream(source):
 *         cdef MessageReader result = MessageReader.__new__(MessageReader)
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_MessageReader, __pyx_n_s_open_stream); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_20)) __PYX_ERR(5, 116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_MessageReader->tp_dict, __pyx_n_s_open_stream, __pyx_t_20) < 0) __PYX_ERR(5, 117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_MessageReader);

  /* "pyarrow/ipc.pxi":374
 *     # 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(5, 374, __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(5, 374, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib__RecordBatchFileReader);

  /* "pyarrow/ipc.pxi":397
 * 
 * 
 * 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_127get_tensor_size, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(5, 397, __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(5, 397, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":407
 * 
 * 
 * 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_129get_record_batch_size, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(5, 407, __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(5, 407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":417
 * 
 * 
 * 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_131write_tensor, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(5, 417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_write_tensor, __pyx_t_20) < 0) __PYX_ERR(5, 417, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":445
 * 
 * 
 * def read_tensor(NativeFile 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_133read_tensor, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(5, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_tensor, __pyx_t_20) < 0) __PYX_ERR(5, 445, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":469
 * 
 * 
 * def read_message(source):             # <<<<<<<<<<<<<<
 *     """
 *     Read length-prefixed message from file or buffer-like object
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_135read_message, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(5, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_message, __pyx_t_20) < 0) __PYX_ERR(5, 469, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":506
 * 
 * 
 * def read_schema(obj):             # <<<<<<<<<<<<<<
 *     """
 *     Read Schema from message or buffer
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_137read_schema, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(5, 506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_schema, __pyx_t_20) < 0) __PYX_ERR(5, 506, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/ipc.pxi":533
 * 
 * 
 * def read_record_batch(obj, Schema schema):             # <<<<<<<<<<<<<<
 *     """
 *     Read RecordBatch from message, given a known schema
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_139read_record_batch, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(5, 533, __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(5, 533, __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(13, 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_18 = __Pyx_CalculateMetaclass(NULL, __pyx_t_20); if (unlikely(!__pyx_t_18)) __PYX_ERR(13, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_Py3MetaclassPrepare(__pyx_t_18, __pyx_t_20, __pyx_n_s_FeatherError, __pyx_n_s_FeatherError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(13, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);
  __pyx_t_15 = __Pyx_Py3ClassCreate(__pyx_t_18, __pyx_n_s_FeatherError, __pyx_t_20, __pyx_t_19, NULL, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(13, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FeatherError, __pyx_t_15) < 0) __PYX_ERR(13, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":20
 * from cpython.ref cimport PyObject
 * 
 * from pyarrow.compat import pickle             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_20 = PyList_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_INCREF(__pyx_n_s_pickle);
  __Pyx_GIVEREF(__pyx_n_s_pickle);
  PyList_SET_ITEM(__pyx_t_20, 0, __pyx_n_s_pickle);
  __pyx_t_18 = __Pyx_Import(__pyx_n_s_pyarrow_compat, __pyx_t_20, -1); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_ImportFrom(__pyx_t_18, __pyx_n_s_pickle); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pickle, __pyx_t_20) < 0) __PYX_ERR(14, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/serialization.pxi":23
 * 
 * 
 * def is_named_tuple(cls):             # <<<<<<<<<<<<<<
 *     """Return True if cls is a namedtuple and False otherwise."""
 *     b = cls.__bases__
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_141is_named_tuple, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_named_tuple, __pyx_t_18) < 0) __PYX_ERR(14, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/serialization.pxi":34
 * 
 * 
 * class SerializationCallbackError(ArrowSerializationError):             # <<<<<<<<<<<<<<
 *     def __init__(self, message, example_object):
 *         ArrowSerializationError.__init__(self, message)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_n_s_ArrowSerializationError); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_20 = PyTuple_New(1); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_GIVEREF(__pyx_t_18);
  PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_18);
  __pyx_t_18 = 0;
  __pyx_t_18 = __Pyx_CalculateMetaclass(NULL, __pyx_t_20); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_19 = __Pyx_Py3MetaclassPrepare(__pyx_t_18, __pyx_t_20, __pyx_n_s_SerializationCallbackError, __pyx_n_s_SerializationCallbackError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(14, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);

  /* "pyarrow/serialization.pxi":35
 * 
 * class SerializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, example_object):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.example_object = example_object
 */
  __pyx_t_15 = __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__339)); if (unlikely(!__pyx_t_15)) __PYX_ERR(14, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (__Pyx_SetNameInClass(__pyx_t_19, __pyx_n_s_init, __pyx_t_15) < 0) __PYX_ERR(14, 35, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "pyarrow/serialization.pxi":34
 * 
 * 
 * class SerializationCallbackError(ArrowSerializationError):             # <<<<<<<<<<<<<<
 *     def __init__(self, message, example_object):
 *         ArrowSerializationError.__init__(self, message)
 */
  __pyx_t_15 = __Pyx_Py3ClassCreate(__pyx_t_18, __pyx_n_s_SerializationCallbackError, __pyx_t_20, __pyx_t_19, NULL, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(14, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SerializationCallbackError, __pyx_t_15) < 0) __PYX_ERR(14, 34, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":40
 * 
 * 
 * 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(14, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_18 = PyTuple_New(1); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_GIVEREF(__pyx_t_20);
  PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_20);
  __pyx_t_20 = 0;
  __pyx_t_20 = __Pyx_CalculateMetaclass(NULL, __pyx_t_18); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __pyx_t_19 = __Pyx_Py3MetaclassPrepare(__pyx_t_20, __pyx_t_18, __pyx_n_s_DeserializationCallbackError, __pyx_n_s_DeserializationCallbackError, (PyObject *) NULL, __pyx_n_s_pyarrow_lib, (PyObject *) NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(14, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_19);

  /* "pyarrow/serialization.pxi":41
 * 
 * class DeserializationCallbackError(ArrowSerializationError):
 *     def __init__(self, message, type_id):             # <<<<<<<<<<<<<<
 *         ArrowSerializationError.__init__(self, message)
 *         self.type_id = type_id
 */
  __pyx_t_15 = __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__341)); if (unlikely(!__pyx_t_15)) __PYX_ERR(14, 41, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (__Pyx_SetNameInClass(__pyx_t_19, __pyx_n_s_init, __pyx_t_15) < 0) __PYX_ERR(14, 41, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;

  /* "pyarrow/serialization.pxi":40
 * 
 * 
 * class DeserializationCallbackError(ArrowSerializationError):             # <<<<<<<<<<<<<<
 *     def __init__(self, message, type_id):
 *         ArrowSerializationError.__init__(self, message)
 */
  __pyx_t_15 = __Pyx_Py3ClassCreate(__pyx_t_20, __pyx_n_s_DeserializationCallbackError, __pyx_t_18, __pyx_t_19, NULL, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(14, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_15);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeserializationCallbackError, __pyx_t_15) < 0) __PYX_ERR(14, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/serialization.pxi":213
 * 
 * 
 * _default_serialization_context = SerializationContext()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_18 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializationContext)); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_default_serialization_context, __pyx_t_18) < 0) __PYX_ERR(14, 213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

  /* "pyarrow/serialization.pxi":275
 * 
 *     @staticmethod
 *     def from_components(components):             # <<<<<<<<<<<<<<
 *         """
 *         Reconstruct SerializedPyObject from output of
 */
  __pyx_t_18 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_18SerializedPyObject_7from_components, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject->tp_dict, __pyx_n_s_from_components, __pyx_t_18) < 0) __PYX_ERR(14, 275, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SerializedPyObject);

  /* "pyarrow/serialization.pxi":274
 *         return output
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_components(components):
 *         """
 */
  __Pyx_GetNameInClass(__pyx_t_18, (PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject, __pyx_n_s_from_components); if (unlikely(!__pyx_t_18)) __PYX_ERR(14, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_18);
  __pyx_t_20 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_18); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7pyarrow_3lib_SerializedPyObject->tp_dict, __pyx_n_s_from_components, __pyx_t_20) < 0) __PYX_ERR(14, 275, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
  PyType_Modified(__pyx_ptype_7pyarrow_3lib_SerializedPyObject);

  /* "pyarrow/serialization.pxi":315
 * 
 * 
 * def serialize(object value, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Serialize a Python sequence
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_143serialize, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize, __pyx_t_20) < 0) __PYX_ERR(14, 315, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":341
 * 
 * 
 * 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_145serialize_to, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_to, __pyx_t_20) < 0) __PYX_ERR(14, 341, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":358
 * 
 * 
 * def read_serialized(source, base=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Read serialized Python sequence from file-like object
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_147read_serialized, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_read_serialized, __pyx_t_20) < 0) __PYX_ERR(14, 358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":384
 * 
 * 
 * def deserialize_from(source, object base, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """EXPERIMENTAL: Deserialize a Python sequence from a file.
 * 
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_149deserialize_from, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 384, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_deserialize_from, __pyx_t_20) < 0) __PYX_ERR(14, 384, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":406
 * 
 * 
 * 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_151deserialize_components, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_deserialize_components, __pyx_t_20) < 0) __PYX_ERR(14, 406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "pyarrow/serialization.pxi":424
 * 
 * 
 * def deserialize(obj, SerializationContext context=None):             # <<<<<<<<<<<<<<
 *     """
 *     EXPERIMENTAL: Deserialize Python object from Buffer or other Python object
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_153deserialize, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(14, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_deserialize, __pyx_t_20) < 0) __PYX_ERR(14, 424, __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_155benchmark_PandasObjectIsNull, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(15, 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(15, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_SerializationContext(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     if __pyx_checksum != 0x9aeed6f:
 *         from pickle import PickleError as __pyx_PickleError
 */
  __pyx_t_20 = PyCFunction_NewEx(&__pyx_mdef_7pyarrow_3lib_164__pyx_unpickle_SerializationContext, NULL, __pyx_n_s_pyarrow_lib); if (unlikely(!__pyx_t_20)) __PYX_ERR(8, 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(8, 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(3); if (unlikely(!__pyx_t_20)) __PYX_ERR(6, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_20);
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_array_line_87, __pyx_kp_u_Create_pyarrow_Array_instance_f) < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_Array_cast_line_360, __pyx_kp_u_Cast_array_values_to_another_da) < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_20, __pyx_kp_u_Table_from_pandas_line_1166, __pyx_kp_u_Convert_pandas_DataFrame_to_an) < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_20) < 0) __PYX_ERR(6, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;

  /* "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:
 */

  /*--- 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;
}

/* 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);
}

/* 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;
}

/* 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);
}

/* 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, int 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, nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

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

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

/* PyFloatBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
    const double b = floatval;
    double a, result;
    if (likely(PyFloat_CheckExact(op1))) {
        a = PyFloat_AS_DOUBLE(op1);
    } else
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        a = (double) PyInt_AS_LONG(op1);
    } else
    #endif
    if (likely(PyLong_CheckExact(op1))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        switch (size) {
            case  0: a = 0.0; break;
            case -1: a = -(double) digits[0]; break;
            case  1: a = (double) digits[0]; break;
            case -2:
            case 2:
                if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                    a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -2)
                            a = -a;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            case -3:
            case 3:
                if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                    a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -3)
                            a = -a;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            case -4:
            case 4:
                if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                    a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -4)
                            a = -a;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            default:
        #else
        {
        #endif
            a = PyLong_AsDouble(op1);
            if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
        }
    } else {
        return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
    }
        PyFPE_START_PROTECT("divide", return NULL)
        result = a / b;
        PyFPE_END_PROTECT(result)
        return PyFloat_FromDouble(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

/* 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;
}

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

/* 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;
}

/* 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
}

/* 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));
}

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

/* 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;
}

/* 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;
}

/* CallUnboundCMethod0 */
  static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_ASSUME_SAFE_MACROS
    args = PyTuple_New(1);
    if (unlikely(!args)) goto bad;
    Py_INCREF(self);
    PyTuple_SET_ITEM(args, 0, self);
#else
    args = PyTuple_Pack(1, self);
    if (unlikely(!args)) goto bad;
#endif
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    Py_DECREF(args);
bad:
    return result;
}

/* py_dict_items */
  static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    if (PY_MAJOR_VERSION >= 3)
        return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d);
    else
        return PyDict_Items(d);
}

/* 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);
}

/* 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");
}

/* 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
}

/* 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;
}

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

/* 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
}

/* 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;
    }
}

/* None */
  static CYTHON_INLINE int64_t __Pyx_div_int64_t(int64_t a, int64_t b) {
    int64_t q = a / b;
    int64_t r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* 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);
    }
}

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

/* SliceObject */
  static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

/* PyIntBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            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);
            }
        }
                {
                    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

/* 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));
}

/* 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;
}

/* 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;
}

/* None */
  static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

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

/* 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
};
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);
}

/* None */
  static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* 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);
}

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

/* 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;
}

/* 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;
}

/* 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);
  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 GOOD;
#else
    if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
#endif
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto 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 BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto 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 BAD;
            ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
            ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto 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 BAD;
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto GOOD;
BAD:
    if (!PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
    ret = -1;
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;
}

/* 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;
}

/* 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;
}

/* 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_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_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_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_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_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_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);
    }
}

static PyObject* __pyx_convert__to_py_struct__arrow_3a__3a_py_3a__3a_PandasOptions(struct arrow::py::PandasOptions s) {
    PyObject* res;
    PyObject* member;
    res = __Pyx_PyDict_NewPresized(5); if (unlikely(!res)) return NULL;
    member = __Pyx_PyBool_FromLong(s.strings_to_categorical); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_n_s_strings_to_categorical, member) < 0)) goto bad;
    Py_DECREF(member);
    member = __Pyx_PyBool_FromLong(s.zero_copy_only); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_n_s_zero_copy_only, member) < 0)) goto bad;
    Py_DECREF(member);
    member = __Pyx_PyBool_FromLong(s.integer_object_nulls); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_n_s_integer_object_nulls, member) < 0)) goto bad;
    Py_DECREF(member);
    member = __Pyx_PyBool_FromLong(s.date_as_object); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_n_s_date_as_object, member) < 0)) goto bad;
    Py_DECREF(member);
    member = __Pyx_PyBool_FromLong(s.use_threads); if (unlikely(!member)) goto bad;
    if (unlikely(PyDict_SetItem(res, __pyx_n_s_use_threads, member) < 0)) goto bad;
    Py_DECREF(member);
    return res;
    bad:
    Py_XDECREF(member);
    Py_DECREF(res);
    return NULL;
  }
  /* 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 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 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 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 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
};
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 */
